You are not logged in.
Hi,
Is there a way in bash to get number of command line args ...
atm I am using $1 but of course if you pass a command like uname -a you need two?
wondered if there is a $<foo> that ill give number of args passed?
EDIT looks like '$#' emmmm lets see....
Mr Green
Offline
ok so I have numbers of args how do I pass them to script
want to pass command uname -a > /tmp/cmd
being 2 args ???
Mr Green
Offline
$# does what you want. Also, check this out here:
http://tldp.org/LDP/abs/html/
Offline
woah!!! ok thanks ..... $# gives me number of args ... will check it out
$1 $2 > /tmp/cmd
messy way.....
Mr Green
Offline