[ale] Shell Scripting question
nick travis
linuxnews at wormfishin.com
Wed Aug 6 13:44:12 EDT 2003
Here's the exact line in the file, I want to pull out the file name from
it.
VIOLATION : PAM service rlogin (/etc/pam.d/rlogin) does not have module
pam_shells.so for module type auth.
...ACTION : Add module pam_shells.so for module type auth to PAM
service rlogin (/etc/pam.d/rlogin).
Example: auth required /lib/security/pam_shells.so
there will be several violations like this in the file, but the file
name will start at a different location each time. since the violation
will be in a different file.
On Wed, 2003-08-06 at 11:32, Geoffrey wrote:
> linuxnews at wormfishin.com wrote:
> > I'm relatively new to shell scripting, and I have a question which
> > hopefully has an easy answer. I have a script that runs and produces an
> > output file. the output file looks something like "you have and error in
> > /this/file" how can I pull the "/this/file" out of this line?
>
> Would help if we new the exact text of the error message rather than
> 'something like, but the following will likely work:
>
> awk '{print $NF}' THE_NAME_OF_THE_OUTPUT_FILE
>
> That is as long as the file name is the last 'field' on that line. A
> field in this case is separated by whitespace.
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list