Skip to main content
3 of 5
added 13 characters in body
Ole Tange
  • 37.5k
  • 34
  • 119
  • 228

Use perl:

perl -e '$a=shift; `<< other code >>`; exit $a' $? # Fails in csh

Edit This works in csh, too:

perl -e '$a=shift; `<< other code >>`; $a=~s/h// and exit $a; exit shift' "$?h" "$status"
Ole Tange
  • 37.5k
  • 34
  • 119
  • 228