Whats the use of () -parentheses
Whats the use of () -parentheses
In the below ex: a=($*) what it means Shell script to print the command line arguments in reverse order if [ $# -eq 0 ] then echo -e "\nNo arguments entered\n" else a=($*) echo "arguments are" echo $* let x=$# echo "arguments in reverse order are : " while [ $x -ne -1 ] do echo -n " ${a[$x]}" let x=x-1 done fi |
In this case you are creating a bash array named "a"
A good introduction to bash arrays http://mywiki.wooledge.org/BashGuide/Arrays PS Please wrap code with bb code tags [code] example code box 2nd line < actually 4 spaces here >3rd line [/code] Code:
example code box |
All times are GMT -5. The time now is 04:12 PM. |