bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: possible to refer to last result?


From: Paul Jarc
Subject: Re: possible to refer to last result?
Date: Fri, 23 Nov 2001 02:35:10 -0500
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/20.7 (i386-redhat-linux-gnu)

Christian Zemlin <chr@itb.biologie.hu-berlin.de> wrote:
> find -name userguide*
> > doc/guides/userguide.ps
>
> (where the last line is bash's answer to the find command),

It's not bash's answer; it's find's own output.  That's why it's not
more easily accessible: that data never passes through bash at all.

> Unfortunately a shell script called "l",
>
> echo $(!!)
>
> does not work, because the !! is not substituted.

Try this shell function:
l() { echo "$(eval "$(history -p '!!')")"; }

Of course, you'll probably want to replace "echo" with something more
interesting.  Otherwise it's just the same as "!!" alone.


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]