Hi,
I have to store all the command line arguments into an array.
I have the following code.
**********************
#! /bin/sh
set -A arr_no_updates
i=1
while [ i -le $# ]
do
arr_no_updates=$($i)
echo ${arr_no_updates[$i]}
i=$(($i+1))
done
****************
But i could not assign the argumen values. please help me!!
In addition, I wish to learn Functions writing in shell script. pls advice me some documrnts or websites. I am very much new to shell scripts. Pls help me to learn. Thank you all in advance..
-----Post Update-----
I have found the below way....
please convey me ,if any other better way of doing this. Thanks..
**************************
set -A arr_no_updates
echo $@
i=1
for arr in $@
do
echo $arr
i=$(($i+1))
done
***************************