Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In linux, assume you are within a shell script, print out the number of command-line arguments fed to the script.
Answer

echo $#

^^ note that $ denotes variable expansion, and # is special variable to represent number of command-line arguments to current script


Question
In linux, assume you are within a shell script, print out the number of command-line arguments fed to the script.
Answer
?

Question
In linux, assume you are within a shell script, print out the number of command-line arguments fed to the script.
Answer

echo $#

^^ note that $ denotes variable expansion, and # is special variable to represent number of command-line arguments to current script

If you want to change selection, open document below and click on "Move attachment"

20. Advanced Shell Scripting
2" ... When there are no positional parameters, "$@" and $@ expand to nothing (i.e., they are removed). [Hint: this is very useful for writing wrapper shell scripts that just add one argument.] <span>$# Expands to the number of positional parameters in decimal (i.e. the number of command-line arguments). $? Expands to the status of the most recently executed foreground pipeline. [I.e.,

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.