Linux – What does $@ mean in a shell script


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 ./ foo bar then $@ will be equal to foo bar.

If you do:

./ foo bar

and then inside 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.