- bash script
- Posted by Christian Christmann on September 14th, 2005
Hi,
I need a bash script which copy all files of a directory
and adds a specific prefix with all newly created
files.
E.g. in the directory I have:
char01, char02 and chartest04
and want the script to create automatically
uchar01, uchar02 and uchartest04
with 'u' as prefix.
Since I'm not familiar with writing scripts I would appreciate
your help.
Thank you.
Chis
- Posted by Phlip on September 14th, 2005
Christian Christmann wrote:
find . -name char\* -exec cp {} new_folder/u{} \;
Warning: I just put a live firecracker in your hands. Use with caution! Look
up the 'find' and 'cp' commands before using that.
And note the documentation for the find command won't assume BASH, so it
can't mention the two critical \ marks to escape the * and ;. Then, the
documentation for BASH won't assume 'find', so you generally have to pick
this stuff up from forums.
This is why Linux is so popular. ;-)
--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
- Posted by Thomas Jollans on September 18th, 2005
Christian Christmann wrote:
it's just a loop.