Hi Monks, Does anyone know how i would capture the return code from a perl one-liner executed from a korn shell script?
perl -i.bak -pe 's/AJZ/AZZ/g if /^AB/' <filename> if [[ $? != 0 ]];then exit 1 fi
if the one-liner fails for any reason I'd like to be able to exit with a failed status from the shell, but what i have doesn't work.
any help would be greatly appreciated. thanks
In reply to Capture error from one-liner by dirtdog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |