When you tap the power of UNIX, use your shell of choice.
Many
iSeries/i5 professionals think of Qshell and i5/OS Portable Application
Solutions Environment (PASE) almost interchangeably. Both environments provide
access to an integrated UNIX environment without the need to manage a separate
partition. In addition, both offer a command shell (a program that runs commands
interactively or from a script) and the ability to run UNIX commands, utilities,
and programs.
Qshell and i5/OS PASE even have similar-looking terminal
environments (Figures 1 and 2).
Figure 1: Qshell Command Entry looks almost identical to PASE (Figure 2,
below). (Click images to enlarge.)
Figure 2: PASE's default Korn shell (also known as "-sh") strongly
resembles Figure 1.
Qshell and PASE have separate sets of utilities
and commands. Some, such as ls and
cd, are present in both environments,
while others, such as diff, are present
in one but not the other.
Does that mean we should choose an environment
based on the commands we wish to use? Perhaps, but it is not a requirement.
Qshell and PASE can execute each other's utilities and commands. For example, in
"Vive la
Diff," I showed how to use PASE's
diff command. I stated that this
command ran more easily in PASE than in Qshell. Reader Randy Adamski asked me
directly, "Is it possible to run this command in Qshell?" The answer was "Yes,"
but that it required locating the command in PASE's default command path,
/QOpenSys/usr/bin.
One definite
difference is that Qshell is EBCDIC-based and PASE is ASCII-based. To put Qshell
to the test, I asked Qshell to execute PHP, an AIX binary that I normally run in
PASE. PHP is an ASCII-encoded program. Did it work in Qshell? Yes. I ran the
PHP –v command to show PHP's
version information, presumably encoded in ASCII. Qshell translated the results
into its EBCDIC environment, proudly showing me the
result:
PHP 4.3.9 (cgi) (built: Feb 4 2005
15:04:33)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c)
1998-2004 Zend Technologies $
Just as Qshell often is able
to reverse its EBCDIC nature when needed, ASCII-based PASE can access EBCDIC
system resources. PASE does this with its commands:
qsh (call a Qshell command) and
system (call a native i5/OS
command).
Qshell vs. PASE Comparison Chart
|
|
Qshell
|
i5/OS PASE
|
|
Product ID
|
5722-SS1 option 30
|
5722-SS1 option 33
|
|
Cost
|
Free
|
Free since V5R2
|
|
Location of commands and utilities
|
/usr/bin
|
/QOpenSys/usr/bin
|
|
Available shells
|
A unique ILE port combining Korn and Bourne
|
Port of AIX with three choices: Korn (-sh, default), Bourne (-bsh), and C
(-csh)
|
|
How to invoke an interactive (terminal) shell
|
|
CALL QP2TERMRuns
Korn shell by default. Accepts parameters to run different programs such as the
C shell: CALL PGM(QP2term)
PARM('/qopensys/usr/bin/csh')
|
|
How to run a UNIX utility, command, or program from standard i5/OS
environment
|
QSH
or STRQSH (yes, same as above). Pass program name and arguments as a single
parameter.
|
CALL QP2SHELL
(for new ILE activation group) or CALL QP2SHELL2
(for caller's activation group). Pass program name and arguments as separate
parameters.
|
|
Case-sensitive?
|
No, unless otherwise instructed
|
Yes, when utilities run from default location, QOpenSys/usr/bin
|
|
Character encoding
|
EBCDIC
|
ASCII
|
|
Implementation of utilities
|
Symbolic links to ILE i5/OS programs in QSHELL library (e.g., /usr/bin/ls = /qsys.lib/qshell.pgm/ls.pgm)
|
AIX binaries
|
How to Choose
I asked IBM's Walt Madden when we should choose one
environment over the other. He suggested, "You might choose i5/OS PASE over
Qshell if the program you are trying to run already exists in the UNIX
(especially AIX) space. Conversely, you might choose Qshell over i5/OS PASE if
the program needs to be tightly coupled to i5/OS ILE APIs."
Additional Resources
This Qshell
tutorial is a fine introduction to Qshell. To go further, read the
definitive Qshell resource, Qshell for
iSeries, by Ted Holt and Fred A. Kulack. To learn about PASE, try this
excellent introductory PASE article by
Walt Madden. Also see the official
PASE documentation.
Alan Seiden is Senior
Developer and Technical Lead at Strategic
Business Systems, Inc., in Ramsey, New Jersey, where he
helps clients reach their business goals using IBM iSeries/i5, Microsoft, and
open-source technology, with an emphasis on usability. Alan is an advisory board
member of the New York City Usability
Professionals Association. Contact Alan at
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
.
|