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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Lists<br />

Asynchronous lists<br />

Sequential lists<br />

24 <strong>Qshell</strong> <strong>Interpreter</strong> (<strong>qsh</strong>)<br />

[!]command1 [ | command2 ... ]<br />

The standard output of command1 is connected to the standard input of<br />

command2. The standard input, standard output, or both of a command is<br />

considered to be assigned by the pipeline before any redirection specified by<br />

redirection operators that are part of the command. The exit status of the pipeline is<br />

the exit status of the last command.<br />

If the pipeline is not in the background (described below), <strong>qsh</strong> waits for all<br />

commands to complete.<br />

If the reserved word ! does not precede the pipeline, the exit status is the exit<br />

status of the last command specified in the pipeline. Otherwise, the exit status is<br />

the logical not of the exit status of the last command. That is, if the last command<br />

returns zero, the exit status is 1; if the last command returns greater than zero, the<br />

exit status is zero.<br />

Because pipeline assignment of standard input or standard output or both takes<br />

place before redirection, it can be modified by redirection. For example:<br />

command1 2>&1 | command2<br />

sends both the standard output and standard error of command1 to the standard<br />

input of command2.<br />

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

A list is a sequence of commands separated by an ampersand (&) or a semicolon<br />

(;), and optionally terminated by a , ampersand, or semicolon. An<br />

AND-OR list is a sequence of commands separated by a && or ||. Both operators<br />

have the same priority.<br />

If a command is terminated by the control operator ampersand (&), <strong>qsh</strong> runs the<br />

command asynchronously. That is, <strong>qsh</strong> does not wait for the command to finish<br />

before running the next command. The format for running a command in the<br />

background is:<br />

command1 & [ command2 & ... ]<br />

If the interactive option is not set, the standard input of any asynchronous command<br />

is set to /dev/<strong>qsh</strong>-stdin-null. The exit status of an asynchronous list is the exit status<br />

of the last command.<br />

Commands that are separated by a semicolon (;) are run sequentially. The format<br />

for a sequential list is:<br />

command1 [ ; command2 ... ]

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

Saved successfully!

Ooh no, something went wrong!