Command history expansion

  • From: <tpgww@xxxxxxxxxxx>
  • To: emelfm2@xxxxxxxxxxxxx
  • Date: Wed, 22 Oct 2008 13:57:11 +1100

On Mon, 20 Oct 2008 15:04:18 +1100
> > >> Ability to use !$, !:1, in a command.
> > >>     
> > > Prepend ">" to send command to external shell 
> > >   
> > 
> > What I'm trying to do is something like:
> > 
> > % some command file1
> > % another command !$
> > 
> > Which doesn't work as the shell doesn't know what the prior command was.
 
For now at least, svn code supports another macro for history expansion
  %!...
where characters after the '%' can be many of the forms available in bash, csh 
(etc?):

 !!     (== !1 or !-1)
 ![-]n  (all values are 'backward' in history)
 !beginswith

any of the above immediately followed by a 'word(s)' specifier:
 :n
 :n-m
 :-m    (== 0 to m)
 :n-$   (== n to last)
 :-$    (== 0 to last)
 :^     (== 1 i.e. first argument)
 :$     (== last)
 :*     (== 1 to last)

shortforms for using immediately previous command
 !^
 !$
 !*

%h... works the same as %!...

Not much tested. Feel free to evaluate, while waiting for 0.5 release.

Regards
Tom


-- 
Users can unsubscribe from the list by sending email to 
emelfm2-request@xxxxxxxxxxxxx with 'unsubscribe' in the subject field or by 
logging into the web interface.

Other related posts:

  • » Command history expansion