i execute a file passing 3 or 4 parameters.
I'm unable to get the parameters inside a loop.
#test.sh
n=1
while ((n <= $#))
do
echo "parm=" $n
file=file$n.txt
((n=n + 1))
done
when i execute test.sh a b c
i get
parm= 1
parm=2
parm=3
whereas i want to get
parm=a
parm=b
parm=c
Your suggestions please
I'm unable to get the parameters inside a loop.
#test.sh
n=1
while ((n <= $#))
do
echo "parm=" $n
file=file$n.txt
((n=n + 1))
done
when i execute test.sh a b c
i get
parm= 1
parm=2
parm=3
whereas i want to get
parm=a
parm=b
parm=c
Your suggestions please