Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: copying a directory to same level
- X-seq: zsh-users 15313
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: copying a directory to same level
- Date: Sat, 21 Aug 2010 09:12:35 -0700
- 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 Aug 21, 3:12pm, zzapper wrote:
}
} (Hope this is not too dumb)
Not dumb, but it's a "cp" thing rather than a shell thing.
} >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
Referring to the "cp" documentation (GNU "info" in this case):
If the last argument names an existing directory, `cp' copies each
SOURCE file into that directory (retaining the same name).
Consequently what you want is:
cp -r vim73/. vim
which will change "." to "vim" if "vim" doesn't already exist, and copy
the contents of vim73/. into vim/. if "vim" already does exist.
--
Messages sorted by:
Reverse Date,
Date,
Thread,
Author