Hi all, I literally only started looking at shell a couple of hours ago.
I am looking to do just one task, which I think should be quite straight forward.
I will try explain it as best I can.........
Basically I am trying to automate the grep command from ubuntu (grep xxx yyy.csv < xxx.csv)
I have a perl script that is going through a large amount of data finding the most common users in a csv file (yyy.csv) I then want to create a list of the top 50 or so of these users and grep their specific information from the file. So it would be like so:
grep user1 yyy.csv < user1.csv
The easiest thing is to probably call the created csv file by the name of the original user (which by the way, if it makes any difference, will be a 32 key hex number)
I was looking at a few sample scripts and I assume the easiest way is to use a
(for i in *) loop
but not too sure exactly the best way to go about this. Should I save the users I want to grep into a csv file from my perl code or does anyone have any suggestions as to what way to go about this problem?
So to summarise i'm looking to generate a script that will automate the following ubuntu commands in one go:
grep user1 yyy.csv < user1.csv
grep user2 yyy.csv < user2.csv
grep user3 yyy.csv < user3.csv
grep user4 yyy.csv < user4.csv
grep user5 yyy.csv < user5.csv
grep user6 yyy.csv < user6.csv
grep user7 yyy.csv < user7.csv
grep user8 yyy.csv < user8.csv
grep user9 yyy.csv < user9.csv
and so on..........
Hope this all makes sense!
Thanks very much,
N