Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to get the ith input argument such that:

./test.sh "what is" "where is" "how" "when"

Say if I want echo the value of the 2nd variable, it should print "where is"
If there is no blank in variable, using $@ $* can easily handle the problem, but I have no idea how to do this now..

..
Never mind, I figure it out..
just do command like

for arg
echo $arg....

Not smart...
Posted
Updated 14-Jan-12 20:45pm
v3

Solved by OP. See explanation in the question.
 
Share this answer
 
Try $x where x is one of 1...9.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900