So you would just need to check if a non-empty error.txt file is created.$ perl -i.bak -pe 's/AJZ/AZZ/g if /^AB/' foobar 2> error.txt ~ $ cat error.txt Can't open foobar: No such file or directory.
In reply to Re: Capture error from one-liner
by Laurent_R
in thread Capture error from one-liner
by dirtdog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |