in reply to Re: Capture error from one-liner
in thread Capture error from one-liner
Sure. Below is an example where the filename is not found. In this case i'd like to be able to capture an error and know that it failed.
perl -i.bak -pe 's/AJZ/AZZ/g if /^AB/' J_BB@ Can't open J_BB@: No such file or directory. echo $? 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Capture error from one-liner
by LanX (Saint) on Sep 19, 2014 at 16:32 UTC |