In linux, in bash scripting, what does $@ mean (give an example to illustrate your knowledge)?
Answer
it expands all the command line variables for example (not including $0): if you have command: ./test.sh one two three, $@ would be: one two three.
^^note: it is useful in cases where you want to give the remaining command-line args to another command, after perhaps removing some via "shift"
Question
In linux, in bash scripting, what does $@ mean (give an example to illustrate your knowledge)?
Answer
?
Question
In linux, in bash scripting, what does $@ mean (give an example to illustrate your knowledge)?
Answer
it expands all the command line variables for example (not including $0): if you have command: ./test.sh one two three, $@ would be: one two three.
^^note: it is useful in cases where you want to give the remaining command-line args to another command, after perhaps removing some via "shift"
If you want to change selection, open document below and click on "Move attachment"
7. Shell Scripting g.sh can now run with multiple arguments on the command-line. 7.9 More on Command-Line Arguments: $@ and $0 Whereas $1 , $2 , $3 , etc. expand to the individual arguments passed to the program, <span>$@ expands to all arguments. This behavior is useful for passing all remaining arguments onto a second command. For instance, if test "$1" = "--special" ; then shift myprog2.sh "$@" fi $0
Summary
status
not learned
measured difficulty
37% [default]
last interval [days]
repetition number in this series
0
memorised 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.