This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Cmd line arg help in stp
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Varun Chandramohan <varunc at linux dot vnet dot ibm dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Mon, 06 Apr 2009 08:53:08 -0400
- Subject: Re: Cmd line arg help in stp
- References: <49D9A70D.8060405@linux.vnet.ibm.com>
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