P
Paul Porcelli
Hi folks,
I have a perl one-liner embedded in a ksh script.
perl -pi.bak -e "s/val/otherval/" inputfile
I'd like to check the return code to know
if the substitution was successful.
If I type:
# perl -pi.bak -e "s/val/otherval/" inputfile
Can't open inputfile: No such file or directory
# echo $?
0
If the file is found i still get a return code of 0
# perl -pi.bak -e "s/val/otherval/" realfile
# echo $?
0
Any ideas ?
Many thanks
Paul
I have a perl one-liner embedded in a ksh script.
perl -pi.bak -e "s/val/otherval/" inputfile
I'd like to check the return code to know
if the substitution was successful.
If I type:
# perl -pi.bak -e "s/val/otherval/" inputfile
Can't open inputfile: No such file or directory
# echo $?
0
If the file is found i still get a return code of 0
# perl -pi.bak -e "s/val/otherval/" realfile
# echo $?
0
Any ideas ?
Many thanks
Paul