sajad torkamani

$@ gives you all the arguments passed to the script or function.

For example, if you have this code:

./my-script.sh one two three

Inside my-script.sh, you can loop over the arguments like this:

for arg in $@; do
  echo "arg: $arg"
done
Tagged: Bash