This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: command line arguments
On Fri, 2006-02-24 at 07:24 -0500, Frank Ch. Eigler wrote:
> How so? If you want to look at them as strings, only refer to
> @1....@NNN.
Ah, I see. I was confused because this doesn't work:
> stap -e 'probe begin {printf("%d (%s)\n", $1,@1);exit()}' hello
parse error: number invalid or out of range
saw: number 'hello' at <input>:1:41
And this doesn't work
> stap -e 'probe begin {printf("%d (%s)\n", $1,@1,$2,@2);exit()}' 42
parse error: command line argument index invalid or out of range
saw: operator ',' at <input>:1:39
But, at least this does...
> stap -e 'probe begin {printf("%d (%s)\n", $1,@1);exit()}' 42
42 (42)
Still, I don't see how you can do anything like getopt to process args.
I see in a later message you are thinking of having some special syntax
to allow variables to be set on the command line? I'd like to see some
real example of how this is supposed to work .
I'd like to see this kind of parsing be possible. How would it work?
> topsys.stp -- -d 5 -n 20
> topsys.stp -- -n 20 -pid 5160,5161
> topsys.stp -- -d 5 -name "metacity"