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.

ADDPJE SBSD(QSYS/QINTER) PGM(QSYS/QP0ZSPWP)<br />

INLJOBS(20) THRESHOLD(5) ADLJOBS(5)<br />

JOBD(QGPL/QDFTJOBD) MAXUSE(1) CLS(QGPL/QINTER)<br />

v Leave the SHELL variable unset. If a script file does not contain a “#!” on the<br />

first line, the script is run in the current activation of <strong>qsh</strong>.<br />

v Set the NLSPATH variable. If you are using English as your language, set the<br />

variable in the environment file using this command:<br />

export NLSPATH='/Q<strong>IBM</strong>/ProdData/OS400/Shell/MRI2924/%N'<br />

You must change the MRI directory in the previous command if you are using a<br />

different language.<br />

v Do not use command substitutions in the value of the PS1 variable. This causes<br />

a new process to be started every time you press the key.<br />

v Use built-in utilities whenever possible because they are run in the current<br />

process.<br />

v Use input redirection instead of cat. For example, the following command:<br />

cat myfile | grep Hello<br />

can be replaced with this command:<br />

grep Hello < myfile<br />

v Make sure script files are in same code page as the code page associated with<br />

the CCSID of the job running <strong>qsh</strong>.<br />

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

Developing your own utilities<br />

You can develop your own utility programs using ILE C/400. You should use<br />

Integrated File System I/O and specify the SYSIFCOPT(*IFSIO) parameter when<br />

creating all of the modules in your utility program using the CRTCMOD or<br />

CRTBNDC CL commands.<br />

If your utility program uses the ILE C/400 functions for standard I/O, you can run<br />

your utility from either the <strong>qsh</strong> command line or the QCMD command line. If your<br />

utility reads and writes directly from descriptors 0, 1, and 2, you can only run your<br />

utility from the <strong>qsh</strong> command line.<br />

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

Differences between <strong>Qshell</strong> and other interpreters<br />

While <strong>qsh</strong> is compatible with standard shell interpreters on other platforms, there<br />

are several differences:<br />

v There is no support for the redirection operator.<br />

v There is no support for a command history list, the HISTSIZE and HISTFILE<br />

variables, and the fc (or hist) built-in utility. As an alternative, the QSH CL<br />

command has support for command retrieval.<br />

v There is no support for command line editing and the EDITOR variable.<br />

v There is no support for the MAIL, MAILCHECK, and MAILPATH variables.<br />

v There is no support for job control. There is no concept of a foreground or<br />

background process group on AS/400. This means it is possible for multiple jobs<br />

to be reading from the terminal at the same time. <strong>qsh</strong> does not support:<br />

Chapter 2. Using <strong>qsh</strong> 9

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

Saved successfully!

Ooh no, something went wrong!