Linux – What does $@ mean in a shell script

bashlinuxshshellunix

What does a dollar sign followed by an at-sign (@) mean in a shell script?

For example:

umbrella_corp_options $@

Best Solution

$@ is all of the parameters passed to the script.

For instance, if you call ./someScript.sh foo bar then $@ will be equal to foo bar.

If you do:

./someScript.sh foo bar

and then inside someScript.sh reference:

umbrella_corp_options "$@"

this will be passed to umbrella_corp_options with each individual parameter enclosed in double quotes, allowing to take parameters with blank space from the caller and pass them on.