From: Daniel Jacobowitz <drow@false.org>
To: Michael Snyder <Michael.Snyder@access-company.com>
Cc: vb <vb@vsbe.com>, gdb@sourceware.org
Subject: Re: access variables in canned command sequences
Date: Sun, 08 Apr 2007 14:06:00 -0000 [thread overview]
Message-ID: <20070408140554.GA13191@caradoc.them.org> (raw)
In-Reply-To: <1175885519.11945.64.camel@svmsnyderlnx.palmsource.com>
On Fri, Apr 06, 2007 at 11:51:59AM -0700, Michael Snyder wrote:
> On Fri, 2007-04-06 at 11:26 -0700, vb wrote:
> > Hello all,
> >
> > I need to be able pass a convenience variable defined in gdb command
> > file to a shell script from inside a canned sequence, something like
> > this:
> >
> > set $offs=0x1ff80000
> > define xyz
> > shell echo offset is $offs
> > end
> >
> > what happens when I run it - the parameter does not get passed to the
> > shell at all:
> >
> > (gdb) xyz
> > offset is
> > (gdb)
> >
> >
> > What gives?!
>
> I imagine that the command "echo offset is $offs" is passed directly
> to the shell. The shell doesn't have a variable $offs, so nothing
> gets printed.
That's right. This would work:
define xyz
printf "offset is %d", $offs
end
The CLI does not have a lot of ways to manipulate strings.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-04-08 14:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-06 18:26 vb
2007-04-06 18:52 ` Michael Snyder
2007-04-08 14:06 ` Daniel Jacobowitz [this message]
2007-04-09 10:19 ` Nick Roberts
2007-04-09 19:39 ` vb
2007-04-09 22:09 ` Nick Roberts
2007-04-10 19:05 ` vb
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070408140554.GA13191@caradoc.them.org \
--to=drow@false.org \
--cc=Michael.Snyder@access-company.com \
--cc=gdb@sourceware.org \
--cc=vb@vsbe.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox