Say I want to get the value of last command line argument using the value in $# (or some other way if u can suggest) how do I do it??
$"$#"
`$"$#"`
These don't work
Say I want to get the value of last command line argument using the value in $# (or some other way if u can suggest) how do I do it??
$"$#"
`$"$#"`
These don't work
eval last_arg=\$$#
echo $last_arg
Regards
$_ is the variable. Works in Korn and bash shells:
$ ls -l test.log
-rw-r----- 1 xxx xxxxxxx 49 Feb 11 08:42 test.log
$ wc -l $_
3 test.log
HTH
Thanks a Lot Buddy!
eval echo \$$# will do
OR
eval "echo \$$#"
...any one of them