From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10322 invoked by alias); 24 Feb 2006 18:44:39 -0000 Received: (qmail 10314 invoked by uid 22791); 24 Feb 2006 18:44:38 -0000 X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 24 Feb 2006 18:44:37 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id k1OIiZM0025365 for ; Fri, 24 Feb 2006 13:44:35 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id k1OIiZ106222; Fri, 24 Feb 2006 13:44:35 -0500 Received: from vpn83-141.boston.redhat.com (vpn83-141.boston.redhat.com [172.16.83.141]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id k1OIiXXv015713; Fri, 24 Feb 2006 13:44:34 -0500 Subject: Re: command line arguments From: Martin Hunt To: "Frank Ch. Eigler" Cc: systemtap@sources.redhat.com In-Reply-To: <20060224122448.GG20902@redhat.com> References: <20060223224218.GE20902@redhat.com> <1140760330.5306.3.camel@dragon> <20060224122448.GG20902@redhat.com> Content-Type: text/plain Organization: Red Hat Inc. Date: Fri, 24 Feb 2006 18:44:00 -0000 Message-Id: <1140806672.3378.24.camel@dragon> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-3.fc4) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00624.txt.bz2 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 :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 :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"