Reply
Wed 23 Nov, 2011 04:14 pm
The thing is I want to write a shell script which will traverse through the log files and it will pick perticular string like client names and date and save the result in a file with pipe as a delimiter.
For Example...
If I am having the list of files such as...
/home/ashish/File.ABC_11-23-2011_090137.log
/home/ashish/File.PQR_11-24-2011_090137.log
/home/ashish/File.MNO_11-25-2011_090137.log
/home/ashish/File.XYZ_11-26-2011_090137.log
Then output should be like...
ABC|11-23-2011
PQR|11-24-2011
MNO|11-25-2011
XYZ|11-26-2011
And this output should be saved in a file.
@Ashish Raval,
You need to look up the usage on commands like, cat, grep, sort and cut. Then just pipe everything together in the right order. You might also need the "find" command as well.
@rosborne979,
Hi Rosborne,
Actually I am new to shell scripts and having basic knoledge of all the commands you have mentioned.
Further guidance will be appriciated...
@Ashish Raval,
Unfortunately I don't remember the details myself, as it's been about 20 years since I worked on shell scripts.
But I don't think what you want to do is all that difficult. You can actually do it in a command line by using pipes "|" to pass output from one command to the input of another.
@rosborne979,
Not an issue Rosborne, Thank you so much for replying fast...