[Dshield] CAUTION email about shell scripting...

Meidinger Chris chris.meidinger at badenit.de
Wed Oct 13 19:01:05 GMT 2004


Well, the correct answer is really:

#!/bin/bash
[ -x /bin/ps ] && PS_CMD=/bin/ps || mail -s "problem finding ps binary"
foo at foo.com

This, of course, goes for all binaries used in the script. Also, an
md5_check funtion would be a good idea. 
I was just too lazy ....

for reference see:
http://www.ariel.com.au/jokes/The_Evolution_of_a_Programmer.html

Cheers,

Chris

> -----Original Message-----
> From: list-bounces at lists.dshield.org 
> [mailto:list-bounces at lists.dshield.org] On Behalf Of J Lake
> Sent: Wednesday, October 13, 2004 20:11
> To: list at lists.dshield.org
> Subject: Re: [Dshield] CAUTION email about shell scripting...
> 
> On Wednesday 13 October 2004 01:15 pm, Meidinger Chris wrote:
> > i'm a bit of a hack of a shell scripter, someone will 
> probably have a 
> > one liner for you, but .....
> >
> > PROC=`ps aux | grep "ssh -C -p 9428 -R" | grep -v grep`
> 
> I am risking sounding like a fool, but I always put full 
> pathnames in shell scripts .... /usr/ucb/ps instead of ps for example.
> 
> anyway i will go away now!
> ~j
> _______________________________________________
> DShield and the Internet Storm Center are sponsored by the 
> SANS Institute.
> To learn more about current SANS training, see http://www.sans.org .
> 
> _______________________________________________
> send all posts to list at lists.dshield.org To change your 
> subscription options (or unsubscribe), see: 
> http://www.dshield.org/mailman/listinfo/list
> 



More information about the list mailing list