zsh-users
 help / color / mirror / code / Atom feed
From: zzapper <david@tvis.co.uk>
To: zsh-users@sunsite.dk
Subject: Re: Substitution
Date: Mon, 18 Apr 2005 11:31:41 +0100	[thread overview]
Message-ID: <4927619bfh6uhfgvstqkea0js4nf7o2qtt@4ax.com> (raw)
In-Reply-To: <42625E80.4020607@cc.iitb.ac.in>

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!)



      parent reply	other threads:[~2005-04-18 10:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-17 13:02 Substitution Saket Sathe
2005-04-17 13:07 ` Substitution Eric Mangold
2005-04-17 13:12   ` Substitution Saket Sathe
2005-04-17 13:18     ` Substitution Eric Mangold
2005-04-17 13:27       ` Substitution Saket Sathe
2005-04-17 13:09 ` Substitution Alexey Tourbin
2005-04-18 10:31 ` zzapper [this message]

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=4927619bfh6uhfgvstqkea0js4nf7o2qtt@4ax.com \
    --to=david@tvis.co.uk \
    --cc=zsh-users@sunsite.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).