Results 1 to 3 of 3
Hi unix wizards
I have a little bit problem here about iterating the arguments that I have passed throught the command line
I know that I can reach the arguments ...
- 02-17-2010 #1Just Joined!
- Join Date
- Feb 2010
- Posts
- 2
Iterating through arguments
Hi unix wizards
I have a little bit problem here about iterating the arguments that I have passed throught the command line
I know that I can reach the arguments by referencing them as "$1 , $2, or so on.." however is it possible to reference those values as well??
To clarify what I mean
for i in `seq 1 ${#}`
do
if[ $(($i)) =="blabla" ] // to check if its an expected argument
then
fi
done
I know that I am missing something very simple but I get stuck
- 02-17-2010 #2Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
Code:if [ "${!i}" = "Benny Hill" ]0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.
- 02-18-2010 #3Just Joined!
- Join Date
- Feb 2010
- Posts
- 2
That's what they call a dummy head.
Thanks dude.! That solved the problem.
To keep in mind, I have used shifting method can be used as well.


Reply With Quote