Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Substitution
- X-seq: zsh-users 8691
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Substitution
- Date: Mon, 18 Apr 2005 11:31:41 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <42625E80.4020607@xxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
On Sun, 17 Apr 2005 18:32:56 +0530, wrote:
>Hi,
>Suppose I've typed these commands:
>
># mv somefile1 /home/saket/stuff/books/
># acroread somefile.pdf
># mv somefile2 /home/saket/stuff/books/
>
>How can I substitute the '/home/saket/stuff/books/' of the first command
>into the last command ?
>Currently I just retype it again :(
We all want this but you have eat a little bit if syntax pie!
Scrolling back in history (ESC) (Uparrow) and then reditting that line is the perhaps the easiest
way.
However
> mv !?saket<TAB>
Would bring up the whole line ready for a little editting
or purist
> mv !?saket?:*<tab>
Would just bring up the parameters
If you know the history number of the line (say 5) with desired parameters you can try
> !5:s/somefile1/somefile2/
and if you don't know the history number
!?saket?:s/somefile1/somefile2/
Have I missed anything? (I surely have!)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author