Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Refereing to elements in current command line
- X-seq: zsh-users 10694
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Refereing to elements in current command line
- Date: Fri, 08 Sep 2006 13:07:34 +0200
- In-reply-to: <Xns98387211C8371zzappergmailcom@xxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Operating-system: Linux 2.6.16.16 i686
- References: <Xns98387211C8371zzappergmailcom@xxxxxxxxxxx>
zzapper <david@xxxxxxxxxx>:
> Sorry if this is an old chestnut
> I often type somethig like
>
> > cp fredjoesid.php danjoesid.php
>
> At Present I use i a binding Control-O to do
>
> > cp fredjoesid.php fredjoesid.php
>
> end then vi edit
> But how else can I do this?
Sounds like a job for history-expansion:
[snip]
zsh% touch fredjoesid.php
zsh% cp fredjoesid.php danjoesid.php
zsh% !:0-1 !:1:s^fred^donny
cp fredjoesid.php donnyjoesid.php
zsh% print -l *.php
danjoesid.php
donnyjoesid.php
fredjoesid.php
[snap]
See 'man 1 zshexpn' /HISTORY EXPANSION for details.
Regards, Frank
Messages sorted by:
Reverse Date,
Date,
Thread,
Author