IBM i5/iSeries Primer(c) Concepts and Techniques for Programmers, Administrators, and Sys[... ]ators
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.
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.
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.