in reply to Re: Capture error from one-liner
in thread Capture error from one-liner
Perl with -p doesn't die if a file doesn't exist
Right you are; a workaround is
qwurx [shmem] ~ > perl -p -e 'BEGIN{$SIG{__WARN__}=sub{die@_}}' nonexi +stent Can't open nonexistent: No such file or directory. qwurx [shmem] ~ > echo $? 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Capture error from one-liner
by choroba (Cardinal) on Sep 19, 2014 at 16:56 UTC |