Hi Folks,
I've prepared a shell script that takes action based on arguments and number of arguments..sample code like:
ARGV=("$@")
ARGC=("$#")
case ${ARGV[1]} in
abc)
if [ $ARGC -eq 3 ]; then
......
else
printf "\nInvalid number of arguments, please check the inputs and try again\n"
fi;;
efg) ... and so on
Now the issue is that I wrote and run that script successfully in bash 3.2 on Max OSX. But when tried to run the same on bash 3 on Solaris it gives error and stop:
'ARGV=' unexpected
I was wondering how the script ran successfully on bash 3.2 and what piece i m missing here to get it work on bash 3?
Really appreciate your help.
Thanks and Regards,
SBC