|
Batch mv and tr script ...
I've done an extensive search all day and asked a bunch of tech friends with dismal results. Hopefully someone here can be my UNIX hero today.
Ex. directory structure
~/color/red/a.txt
~/color/blue/b.txt
~/color/green/c.txt
~/rainbow/
For simplicity sake my ex. only has 3 different files but what I'm really working on is a HUGE file system with many files I need to analyze later. What I want to accomplish is to create a csh script which will sit in my home directory and automatically pluck out the .txt file from each color subdirectory and drop it into ~/rainbow The script has to specifically pick out the txt files because each subdir has lots of junk in them.
The second thing the script must do is convert the *.txt files using a simple code
Ex. a=1, b=2, c=3
The result after ls ing ~/rainbow should be something like this.
$ls rainbow
1.txt
2.txt
3.txt
I'm thinking I'll definitely need to | stuff, as well as use the xargs command but other than that I'm lost. And maybe there are far easier ways to do this. If you guys can solve this for me it would be a life saver. :-D
Thanks,
OrangeWarp
|