Sounds like some kind of wrapper script really would be best. Am on mobile right now so I can't test if the following works for compilation errors too, but END blocks should normally allow you to change the exit code, e.g. this at the top of your script: END { $? = 254 if $? == 255 } (again, warning, untested)