29.06.2013 Views

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

Qshell Interpreter (qsh) - FTP Directory Listing - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Options<br />

Operands<br />

Exit status<br />

Related information<br />

Examples<br />

When the -p option is specified, <strong>qsh</strong> displays the current action for the specified<br />

condition(s) .<br />

When no arguments are specified, <strong>qsh</strong> displays a list of the currently defined traps.<br />

v -p Display each trap in a re-enterable format.<br />

For action, you can specify:<br />

v Null to ignore condition when it arises<br />

v Minus (-) to reset condition to its original value.<br />

v A command to be run each time condition arises.<br />

For condition, you can specify:<br />

v Name or number of a signal. You can use kill -l to display a list of valid signals.<br />

For portability, you should always specify the signal name.<br />

v 0 or EXIT. <strong>qsh</strong> runs action when the shell exits.<br />

v ERR. <strong>qsh</strong> runs action when a command has a non-zero exit status.<br />

v DEBUG. <strong>qsh</strong> runs action after each simple command.<br />

If more than one condition arises at the same time, <strong>qsh</strong> runs the traps in this order:<br />

1. DEBUG, if it is specified, then<br />

2. ERR, if it is specified and applicable, then<br />

3. Any other specified traps in signal number order, then<br />

4. EXIT.<br />

v 0 when successful.<br />

v >0 when an invalid condition is specified.<br />

v “kill - Terminate or signal processes”<br />

v “wait - Wait for process completion”<br />

1. Set a trap for the ERR condition: trap ′print Command failed’ ERR<br />

2. Ignore the ERR condition: trap ′’ ERR<br />

3. Reset the ERR condition to its original value: trap - ERR<br />

4. Display the current action for the ERR condition: trap -p ERR<br />

5. Display all of the currently defined traps: trap<br />

[ Legal | AS/400 Glossary ]<br />

Chapter 4. Utilities 91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!