Hi all
i want to list out all command line arguments except $1 i have passed to a script.
Ex: sh cmdline.sh one two three four five
o/p:
two three four five
Hi all
i want to list out all command line arguments except $1 i have passed to a script.
Ex: sh cmdline.sh one two three four five
o/p:
two three four five
It's probably been asked before, try to search the forums.
Anyway,
echo $@
is what you're looking for.
Regards.
cat cmdline.sh
#!/usr/bin/sh
shift
echo $@
sh cmdline.sh one two three four five
two three four five
If you want to preserve the argument list, you can do :
arg1="$1"
shift
echo $@
set -- "$arg1" "$@"
Jean-Pierre.