Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: copying to a deep parallel directory



On Wed, 06 Nov 2013 17:21:23 +0000 (UTC)
zzapper <david@xxxxxxxxxxxxxx> 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 <file> ${PWD/html/live}

This syntax gets a bit messy if you're changing multiple levels
since you need to quote the slashes.

pws



Messages sorted by: Reverse Date, Date, Thread, Author