[wplug] bash script need help

Mackenzie Morgan macoafi at gmail.com
Mon Dec 3 18:03:29 EST 2007


Replace where the filename goes with $1

You should probably also check that a filename has been specified (by
checking that there's an argument), but I forget how.  If you want to get
fancy, once you find out how many args there are, you could have it loop
through and do it for each specified arg, and then you could use ./email-
script.sh foo bar baz and it'd check files foo, bar, and baz

On Dec 3, 2007 5:54 PM, Zach <netrek at gmail.com> wrote:

> Hi,
>
> I have a bash script I use to parse out email addresses from log
> files, it doesn't work 100% but is good enough to seperate out most of
> the wheat from the chaf! The problem is it is hardcoded to use one
> filename at a time so I must keep editing the file, changing the
> filename, saving script, running it, etc. Anyone know how I can make
> this script work on any logfile so I can do: email-script.sh foo
>
> email-script.sh:
>
> grep @ /tmp/trekmsglog | grep -v @$ | grep -v \( | grep -vi bomb |
> grep -v \! | grep -v ++ | grep -v crippled | grep -v "has no gas" | grep
> -v 4.4.
> 0.4 | grep -vi "clue game" | grep -v " @$" | grep -v Pick | grep -v
> Carrying | m
> ore
>
> Zach
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
>



-- 
Mackenzie Morgan
Linux User #432169
ACM Member #3445683
http://ubuntulinuxtipstricks.blogspot.com <-my blog of Ubuntu stuff
apt-get moo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.wplug.org/pipermail/wplug/attachments/20071203/553a5392/attachment.html


More information about the wplug mailing list