Hi,
I am a newbie in shell scripting. I have to copy a particular sub-directory (data) from a large no. of directories (all in the same folder) and paste them to another directory ( /home/hubble/data ) and then rename all the subdirectories (data) as the name of its parent directory.
The subdirectory name is "data", and the directories containing it have random names all starting with 00 (eg: 001276499_results). I want to copy it into "/home/hubble/data" with every subdirectory (data) having the name of its parent directory ( 00......... _......).
yes, i tried it. unfortunately, it isn't working.. After pressing enter, just the secondary prompt string came up and nothing happened..
Also, although i dont get ur code but as you used mv command, I should say again that i want to just copy them (not move).
ran the code again. It is giving error like:
cp: cannot stat `./data': No such file or directory
and then all the directories: ./0012....._results/data/ were omitted by cp..
---------- Post updated at 04:58 AM ---------- Previous update was at 04:47 AM ----------
ok i think i got this.. shld use -R option with cp as copying a directory...