Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
12-04-2004, 10:18 PM #1
- Join Date
- Dec 2004
- Thanked 0 Times in 0 Posts
KSH help! passing variables to functions
okay, I have the following code. (korn shell script in unix).
#main starts here
for((i=1; i<$#; i++))
#end of program
#the $# variable is a count of the number of vars #passed to main from the command line.
#here, $i is the first command line variable. I want to #pass that variable to function abc. then i want the
#value of $2, then value of $3, etc.
when i do this, it actually passes $i rather than the value of $i. i have tried every type of syntax modification to the function call, but can't seem to make this work. any help would be GREATLY appreciated. thank you!
Last edited by Nevermore84; 12-04-2004 at 10:20 PM.