The Autopackage API

Table of Contents / Public library / Miscellaneous functions

Miscellaneous functions

Functions in this category

pushOptE
popOptE


Details

pushOptE
Syntax: pushOptE
Pushes the shell option e onto a stack. The e option controls whether a script should exist on the first line that fails. If you write a function that might be called from a script with option set, and you don't want this to affect the functions operation, you can push the option using this function, then run `set +e` to clear the flag. When leaving the function, popping the stack returns the option to the state it was in before.
Example:
function foo() {
  pushOptE; set +e;
  (perform some code that may return a non-zero exit code)
  popOptE
}


popOptE
Syntax: popOptE
Pops the stack for the shell option e. See pushOptE for more details


Last update: 10/6/2003