http://qs321.pair.com?node_id=1101255


in reply to Capture error from one-liner

At it's simplest, could it not be ...
set -e [ -f $fname ] && [ -r $fname ] perl -i.bak -pe 's/AJZ/AZZ/g if /^AB/' $fname
Just a thought ...

A user level that continues to overstate my experience :-))