First page Back Continue Last page Graphics
for Loop Example (using $@)
declare -i count=0
for x; do
let count+=1
echo Arg $count is $x
done
If the command line had been invoked as:
./test-script apple banana cherry
Then the output from the for loop will be:
Arg 1 is apple
Arg 2 is banana
Arg 3 is cherry