Running Qshell


You can run Qshell in an interactive (conversational) mode or a batch mode. In either case, use the CL command Start Qshell (STRQSH or QSH) to start the Qshell interpreter.

Conversational Qshell

If you type QSH and press Enter from a CL command line, Qshell will open a command-entry screen that is similar to a CL command-entry display. The top of the display shows a history of the commands that have run, and the bottom of the screen contains a large entry area where you can enter Qshell commands. This display is shown in Figure 27.1.

image from book
Figure 27.1: The Qshell command entry panel allows immediate execution of Qshell commands.

When you enter a Qshell command and press Enter, the system echoes the command in the top part of the display and shows you any output generated by the command. If the last line of the command history shows the Qshell promptnormally a dollar sign($), Qshell is ready for a command.

In Figure 27.2, the user has entered two commands. The first, ls c*, displayed a list of all files in the current directory whose names begin with the letter c. The second command, cat cust.csv, displayed the contents of file cust.csv. Since the last line of the history area shows the $ prompt, Qshell is waiting for another command.

image from book
Figure 27.2: QSH command entry, showing $ prompt.

You may press either F3 (Exit) or F12 (Disconnect) to leave Qshell and return to the CL environment. The two options are not identical. If you press F3, the Qshell session ends. If you press F12, the Qshell session is suspended. That is, it remains active in memory. To resume the Qshell session, run the QSH (or STRQSH) command again. If you sign off while a Qshell session is suspended, the system will end the Qshell session.

Nonconversational Qshell

You can also tell Qshell to run one command and quit. In this case, no conversational Qshell session opens. This is Qshell's nonconversational mode. You may run it in either interactive or batch jobs.

To run a command in this mode, enter a valid Qshell command in the CMD parameter of the STRQSH (or QSH) command. Figure 27.3 contains the source code of a CL program that creates an uppercase version of a file member. The Qshell command is stored in variable &COMMAND.

image from book
Figure 27.3: You may run Qshell commands from CL programs.

image from book
Figure 27.3: You may run Qshell commands from CL programs.

image from book
Figure 27.3: You may run Qshell commands from CL programs.



IBM i5/iSeries Primer(c) Concepts and Techniques for Programmers, Administrators, and Sys[... ]ators
IBM i5/iSeries Primer(c) Concepts and Techniques for Programmers, Administrators, and Sys[... ]ators
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 245

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net