From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9671 invoked from network); 18 Apr 2005 10:32:28 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Apr 2005 10:32:28 -0000 Received: (qmail 82818 invoked from network); 18 Apr 2005 10:32:18 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Apr 2005 10:32:18 -0000 Received: (qmail 11548 invoked by alias); 18 Apr 2005 10:32:10 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8691 Received: (qmail 11528 invoked from network); 18 Apr 2005 10:32:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Apr 2005 10:32:08 -0000 Received: (qmail 81742 invoked from network); 18 Apr 2005 10:32:08 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by a.mx.sunsite.dk with SMTP; 18 Apr 2005 10:32:01 -0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DNTTs-0001WA-UE for zsh-users@sunsite.dk; Mon, 18 Apr 2005 12:27:52 +0200 Received: from 56.102-84-212.ippool.ndo.com ([212.84.102.56]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Apr 2005 12:27:52 +0200 Received: from david by 56.102-84-212.ippool.ndo.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Apr 2005 12:27:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk From: zzapper Subject: Re: Substitution Date: Mon, 18 Apr 2005 11:31:41 +0100 Message-ID: <4927619bfh6uhfgvstqkea0js4nf7o2qtt@4ax.com> References: <42625E80.4020607@cc.iitb.ac.in> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 56.102-84-212.ippool.ndo.com X-Newsreader: Forte Free Agent 2.0/32.652 Sender: news X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 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 Would bring up the whole line ready for a little editting or purist > mv !?saket?:* 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!)