From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19188 invoked by alias); 6 Nov 2013 20:10:46 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18107 Received: (qmail 10397 invoked from network); 6 Nov 2013 20:10:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Date: Wed, 6 Nov 2013 14:03:19 -0600 From: Dan Nelson To: Peter Stephenson Cc: zsh-users@zsh.org Subject: Re: copying to a deep parallel directory Message-ID: <20131106200319.GK63947@dan.emsphone.com> References: <20131106175115.09d0cf95@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131106175115.09d0cf95@pwslap01u.europe.root.pri> X-OS: FreeBSD 9.1-STABLE User-Agent: Mutt/1.5.22 (2013-10-16) X-Virus-Scanned: clamav-milter 0.98 at email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (email2.allantgroup.com [172.17.19.78]); Wed, 06 Nov 2013 14:03:23 -0600 (CST) X-Scanned-By: MIMEDefang 2.73 In the last episode (Nov 06), Peter Stephenson said: > On Wed, 06 Nov 2013 17:21:23 +0000 (UTC) > zzapper wrote: > > Say I want to copy a file from > > > > /var/www/html/admin/include/ > > > > to > > > > /var/www/live/admin/include/ > > > > I can of course > > > > cd html live > > > > and then I can use $OLDPWD or ~+1 > > > > but is there anything niftier? > > So we're assuming you're in the former directory... > > cp ${PWD/html/live} > > This syntax gets a bit messy if you're changing multiple levels > since you need to quote the slashes. I use brace expansion a lot for things like this. cp /var/www/{html,live}/admin/include/file.html -- Dan Nelson dnelson@allantgroup.com