I guess I only gave you one piece of the puzzle.&nbsp; &quot;ls&quot; also errors if the file doesn&#39;t exist and (with the way this script is written) it causes the script to die. Using globs or File::Find prevents that from happening.&nbsp; Once we find that file, then we search it for &quot;interesting strings&quot; and send emails out.<br>
<br>Very basic Perl functionality, yet the original author didn&#39;t understand some basic concepts of Perl.&nbsp; Like how subroutines work, and the fact that not all variables need to be global.<br><br>Sorta reminds me with the Perl script I ran into 15 years ago that did `grep $str $filename` to search a file. :)<br>
<br>Yes, my little File::Find snippet works well!&nbsp; Now on to correct other sins committed in this script.<br><br><div class="gmail_quote">On Thu, Nov 6, 2008 at 2:39 PM, Kevin <span dir="ltr">&lt;<a href="mailto:sharpestmarble@gmail.com">sharpestmarble@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">If &quot;ls&quot; is aliased to put filesizes in front, then you shouldn&#39;t count<br>
on ls being in /bin. Instead, you should figure out where it is.<br>
<br>
`which ls | grep -v alias | tr -d &#39;\t&#39;`<br>
<div><div></div><div class="Wj3C7c"><br>
On Thu, Nov 6, 2008 at 2:33 PM, Jay Hannah &lt;<a href="mailto:jay@jays.net">jay@jays.net</a>&gt; wrote:<br>
&gt; Mike Hostetler wrote:<br>
&gt;&gt;<br>
&gt;&gt; It&#39;s ironic that you put that, since that&#39;s pretty much the exact command<br>
&gt;&gt; I&#39;m replacing. :) &nbsp;The problem is that one some of these systems &quot;ls&quot; is<br>
&gt;&gt; aliases to always put filesize in front (why? &nbsp;I don&#39;t know -- I find it<br>
&gt;&gt; annoying).<br>
&gt;&gt;<br>
&gt;<br>
&gt; You can&#39;t specify /bin/ls to avoid aliases?<br>
&gt;<br>
&gt;&gt; This is what I came up with after some googling and piecemailing.<br>
&gt;&gt; &nbsp;Anonymous<br>
&gt;&gt; subroutines are a good thing!<br>
&gt;&gt;<br>
&gt;<br>
&gt; Yay! So you&#39;re all set? &nbsp; :)<br>
&gt;<br>
&gt; j<br>
&gt;<br>
&gt;<br>
&gt; &lt;blasphemy&gt;<br>
&gt; I wonder if Windows PowerShell knocks this problem out of the park?<br>
&gt;<br>
&gt; <a href="http://en.wikipedia.org/wiki/Windows_PowerShell" target="_blank">http://en.wikipedia.org/wiki/Windows_PowerShell</a><br>
&gt; &lt;/blasphemy&gt;<br>
&gt; _______________________________________________<br>
&gt; Omaha-pm mailing list<br>
&gt; <a href="mailto:Omaha-pm@pm.org">Omaha-pm@pm.org</a><br>
&gt; <a href="http://mail.pm.org/mailman/listinfo/omaha-pm" target="_blank">http://mail.pm.org/mailman/listinfo/omaha-pm</a><br>
&gt;<br>
_______________________________________________<br>
Omaha-pm mailing list<br>
<a href="mailto:Omaha-pm@pm.org">Omaha-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/omaha-pm" target="_blank">http://mail.pm.org/mailman/listinfo/omaha-pm</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mike Hostetler<br><a href="http://mike.hostetlerhome.com/">http://mike.hostetlerhome.com/</a><br><br><br>