if [ "X${substitute}" = "Xy" -o "X${substitute}" = "XY" ] then cat $inputfile | perl -e 'while() { 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