Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
if [ "X${substitute}" = "Xy" -o "X${substitute}" = "XY" ] then cat $inputfile | perl -e 'while(<STDIN>) { if( length( $_ ) > 3 ) { @args=split(/\|/,$_); if( $args[1] eq '$service' && $args[3] eq '$bundle' ) { @args=split(/\|/,$_); $args[4] =~ s/N/Y/; print join("|",@args); } else { print $_ } } else { print $_ } }' > $tmpfile
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Syntax question...
by Fletch (Bishop) on Apr 17, 2002 at 16:24 UTC | |
|
Re: Syntax question...
by Juerd (Abbot) on Apr 17, 2002 at 16:22 UTC | |
|
Re: Syntax question...
by jepri (Parson) on Apr 17, 2002 at 16:21 UTC | |
|
Re: Syntax question...
by erikharrison (Deacon) on Apr 17, 2002 at 16:24 UTC |