Hi,
Please guide to pass an array as a arg to a script...
for example,
I have a script small.sh to find the small no of given arg as below...
#! /bin/sh
# this script is for finding the small number
set -A arr_no_updates
small=$1
i=1
for arr in $@
do
if [ $arr -ne 0 ]
then
if [ $arr -le small ]
then
small=$arr
fi
fi
i=$(($i+1))
done
echo $small
Now i like to use this script for muliple times in another script called secondscript.sh
please help me on the following
1.how to call the small.sh
2.how to pass the array as arg
3.how to get the result
I tried for the non array codes, i could get the perfect result with the below lines..
chmod 777 small.sh
./small.sh 10 20 30
please help me hw to arg a array.. Thankyou all in advance...