On Dec 3, 2007 5:54 PM, Zach &lt;<a href="mailto:netrek@gmail.com">netrek@gmail.com</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>I have a bash script I use to parse out email addresses from log<br>files, it doesn&#39;t work 100% but is good enough to seperate out most of<br>the wheat from the chaf! The problem is it is hardcoded to use one
<br>filename at a time so I must keep editing the file, changing the<br>filename, saving script, running it, etc. Anyone know how I can make<br>this script work on any logfile so I can do: email-script.sh foo<br><br>email-script.sh
:<br><br>grep @ /tmp/trekmsglog | grep -v @$ | grep -v \( | grep -vi bomb |<br>grep -v \! | grep -v ++ | grep -v crippled | grep -v &quot;has no gas&quot; | grep -v 4.4.<br>0.4 | grep -vi &quot;clue game&quot; | grep -v &quot; @$&quot; | grep -v Pick | grep -v Carrying | m
<br>ore<font color="#888888"></font></blockquote><div><br>Replace the file name with $1, which means the first argument, or $* to mean all of the arguments (that way the grep runs over more than one file, if provided).<br>
<br>You could save a lot of time and processes by using egrep, and all the &#39;grep -v&#39; into one expression, delimited by &#39;|&#39;, i.e.<br><br>egrep -v &#39;@$|bomb|\!|\+\+|crippled&#39; (etc)<br><br></div></div>
-- <br>W. Banguna &lt;<a href="mailto:wbanguna@GMail.COM">wbanguna@GMail.COM</a>&gt;