Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: copying a directory to same level
- X-seq: zsh-users 15319
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: zzapper <david@xxxxxxxxxx>
- Subject: Re: copying a directory to same level
- Date: Sun, 22 Aug 2010 14:32:46 -0400 (EDT)
- Cc: zsh-users@xxxxxxx
- In-reply-to: <Xns9DDBA4E47D3B3zzappergmailcom@xxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <Xns9DDBA4E47D3B3zzappergmailcom@xxxxxxxxxxxx>
On Sat, 21 Aug 2010, zzapper wrote:
> Hi
> (Hope this is not too dumb)
>
> I want to duplicate directory vim73 to vim
>
> >cp -r vim73 vim/
>
> if directory vim does not exist then it does what I want. However if
> vim/ already exists then vim73/ will be created as a sub-directory in
> vim/ eg vim/vim73
>
> Can you explain this behaviour and how can I force it duplicate to
> same level regardless of whether directory exists
Personally, I use rsync for anything like this. For your particular use
case, you'd want:
rsync -r vim73/ vim/
Note the trailing slash on vim73/. If you omit it, you'll get a
vim/vim73/ subdirectory. In both cases, though, the final outcome
doesn't depend on whether vim/ already exists.
Although, it also sounds suspiciously as though you're trying to go
against recommendations and muck about in the $VIM/ or $VIMRUNTIME/
directories directly (rather than making modifications in your own home
directory).
Or, maybe you're looking for symbolic links. I've seen on many systems:
/usr/share/vim/current -> vim72
Modified for what I assume you might want in your example, that can be
created by:
ln -s vim73 /usr/share/vim/vim
--
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author