LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-22-2011, 08:42 AM   #1
raahul07
LQ Newbie
 
Registered: Aug 2011
Posts: 5

Rep: Reputation: Disabled
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
 
Old 08-22-2011, 08:58 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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
 
1 members found this post helpful.
Old 08-22-2011, 11:17 AM   #3
raahul07
LQ Newbie
 
Registered: Aug 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by David the H. View Post
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
 
Old 08-22-2011, 11:21 AM   #4
raahul07
LQ Newbie
 
Registered: Aug 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Please provide some help with code.
Any help wud be gr8ly appreciated
 
Old 08-22-2011, 11:33 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
 
Old 08-22-2011, 06:38 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I read the audit time stamp? msg=audit(1213186256.105:20663) abefroman Linux - Software 3 04-21-2011 06:37 PM
Generate audit log every 6 months it_guy Red Hat 2 03-11-2011 07:18 AM
[Linux Audit]: Which groups should be allowed to read audit log files? quanba Linux - Security 1 11-15-2010 10:09 AM
RSS XML File to be read and generate HTML page redhatrosh General 10 02-15-2006 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration