Whenever you pass command line arguments
toa unix shell script you can access it using $ (dollar sign) with
argument number. For example,
the first argument can be accesses
as $1, second argument can be accesses as $2 and so on till $9 . However
, while accessing 10th argument if you use $10 , it will print value of
1st argument and append 1 to it . For example , if your first argument
is "a", it will print a1..So to access it, you have to put it in curly
braces{}, For example, if you have to access the 10 argument, you should
write is as ${10}.
No comments:
Post a Comment