[Kc] Using Perl

Garrett Goebel ggoebel at goebel.ws
Sun Jul 30 08:05:16 PDT 2006


Well, perhaps you'd like to submit a "best practices" version?

cheers,

Garrett

On Jul 29, 2006, at 8:53 AM, Scott Kahler wrote:

> If I ever saw someone using code like this on one of our work machines
> they would be beaten about the head and neck with a large pipe.  It is
> cool and fun stuff.. if you are going to be the only one running and
> maintaining that code.
>
> On Thu, 2006-07-27 at 21:35 -0500, Eric wrote:
>> Second Offering:
>>
>> bash-2.03# cat build_all_server_shutdown.sh
>> #!/bin/bash
>> USERNAME="username"
>> PASSWORD="password"
>>
>> LOGFILE="all_server_shutdown.txt" \
>> COMMAND="psshutdown" \
>> CLOPTIONS="-s -t 1 -u ${USERNAME} -p ${PASSWORD}" \
>> /usr/bin/perl -ne 'BEGIN { $d=("-")x5; $r="REM"; $fn=$ENV 
>> {LOGFILE}; @cmd=($ENV{COMMAND}." ".$ENV{CLOPTIONS}." \\\\"," >>  
>> $fn"); $fl=<>; print "$r ${fl}erase $fn\n"; } next if /^(#)|($r)/;  
>> tr/a-z\r\n /A-Z/d; $_=(/^(SVR_)|(other)/i?"$r\n$r [$d$_$d]\n":join 
>> ($_, at cmd)."\n"); print;' < $1 > $2
>>
>>
>> Eric
>
>
> Scott Kahler
> =-=-=-=-=-=-=-=-=-=-=-=-=
> MC 900ft Perl Programmer
> http://www.uclick.com
> 816-210-8884
> scottk at uclick.com
> =-=-=-=-=-=-=-=-=-=-=-=-=
>
> Brain: Gone at last, obsequious buffoons.
> Pinky: Right-O Brain. Narf! Obsequious!
> Brain: Pinky, do you have any idea what obsequious means?
> Pinky: No, but it sounds squishy! Ooo I love squishy!
>
>
>
> _______________________________________________
> kc mailing list
> kc at pm.org
> http://mail.pm.org/mailman/listinfo/kc
>



More information about the kc mailing list