Cmd line arg help in stp
Frank Ch. Eigler
fche@redhat.com
Mon Apr 6 12:53:00 GMT 2009
Varun Chandramohan <varunc@linux.vnet.ibm.com> writes:
> Iam looking at a way to iterate the multiple command line
> arguments i passed with my script.
>[...]
> Can somone help me with writing a sample code in system tap that can
> do this? I need something similar to what the below script does
>
> while [ $# -gt 0 ]
> do
>
> echo $1
> shift
> done
This just works:
probe begin {
for (i=1; i<argc; i++)
log(argv[i])
}
However, we don't have many string processing functions yet, so
parsing each parameter at run time is clunky.
- FChE
More information about the Systemtap
mailing list