Got some odd behaviour coming out of a bash script
myscript.sh
#! /bin/bash
# Demo bash script
for i in $@
do
echo $i
done
echo $# args
if I execute it thus:
myscript.sh "Arg 1" "Arg 2"
Result:
Arg
1
Arg
2
2 args
So it's calculating the correct number of args but processing them wrong or more to the point I'm processing them wrong
Any thoughts?