LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   To generate read an audit file (https://www.linuxquestions.org/questions/linux-newbie-8/to-generate-read-an-audit-file-898759/)

raahul07 08-22-2011 08:42 AM

To generate read an audit file
 
Hi all,
I am a newbie to shell scripting, and i have to write a shell program for following senario:

-:take a .aud file from a given directory and run the following command audengine -aud account_name filter_1 filter_2 aud_file.aud

-: this command will generate a .log file
-: now i have to grep the account number(say x) and say 10 lines above and below it from this log file and pass it into another file in .txt format in some other directory

David the H. 08-22-2011 08:58 AM

That's nice. Good luck to you.



Oh, wait, did you want some help or advice? Well why didn't you say so? Just where are you having problems?

In the meantime, here's a good introduction to bash. Perhaps it will be of some help.
http://mywiki.wooledge.org/BashGuide

raahul07 08-22-2011 11:17 AM

Quote:

Originally Posted by David the H. (Post 4450114)
That's nice. Good luck to you.



Oh, wait, did you want some help or advice? Well why didn't you say so? Just where are you having problems?

In the meantime, here's a good introduction to bash. Perhaps it will be of some help.
http://mywiki.wooledge.org/BashGuide


Thanks for the book David, also if you can provide some help with the coding it would really be v nice of you.In the mean time i am reading the book:)

raahul07 08-22-2011 11:21 AM

Please provide some help with code.
Any help wud be gr8ly appreciated

David the H. 08-22-2011 11:33 AM

When you have specific questions, we'll be glad to help you. But please do what you can first.

You should start by breaking it down into separate actions and figure out how to do each step individually first.

chrism01 08-22-2011 06:38 PM

If you want to grab the preceding and following 10 lines, try grep using the -A & -B flags http://linux.die.net/man/1/grep


All times are GMT -5. The time now is 04:21 PM.