marcus-g
5/17/2017 - 6:52 AM

Iterate through shell arguments using "for" and "$@" From http://stackoverflow.com/questions/255898/how-to-iterate-over-arguments-in-a-bash

Iterate through shell arguments using "for" and "$@"

From http://stackoverflow.com/questions/255898/how-to-iterate-over-arguments-in-a-bash-script

for var in "$@"
do
    echo "$var"
done

# output
# sh test.sh 1 2 '3 4'
# 1
# 2
# 3 4