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.

then list4 ] ...<br />

[ else list5 ]<br />

case conditional construct<br />

while loop<br />

until loop<br />

fi<br />

First, <strong>qsh</strong> runs list1 and if its exit status is zero then <strong>qsh</strong> runs list2. Otherwise, each<br />

elif list3 is run and if its exit status is zero then <strong>qsh</strong> runs list4. Otherwise, <strong>qsh</strong> runs<br />

list5.<br />

The syntax of the casecommand is<br />

case word in<br />

pattern1 ) list1 ;;<br />

pattern2 | pattern3 ) list2 ;;<br />

...<br />

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

esac<br />

<strong>qsh</strong> expands each pattern in turn and sees if it matches the expansion of word.<br />

When there is a match, <strong>qsh</strong> runs the corresponding list. After the first match, no<br />

more patterns are expanded. See “Shell Patterns” (page 18) for more details on<br />

patterns.<br />

The syntax of the while command is<br />

while list1<br />

do list2<br />

done<br />

<strong>qsh</strong> runs the two lists repeatedly while the exit status of list1 is zero. When the exit<br />

status of list1 is non-zero the command completes.<br />

The syntax of the until command is<br />

until list1<br />

do list2<br />

done<br />

<strong>qsh</strong> runs the two lists repeatedly while the exit status of list1 is non-zero. When the<br />

exit status of list1 is zero the command completes.

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

Saved successfully!

Ooh no, something went wrong!