The shell that you'll likely use for scripting under QNX Neutrino is ksh, a
public-domain implementation of the Korn shell.
The sh command is usually a symbolic link to ksh.
For more information about this shell, see:
- the Using the Command Line chapter in this guide
- the entry for
ksh
in the Utilities Reference
- Rosenblatt, Bill, and Arnold Robbins. 2002. Learning the Korn Shell,
2nd Edition. Sebastopol, CA: O'Reilly & Associates. ISBN 0-596-00195-9
QNX Neutrino also supplies or uses some other scripting environments:
- An OS buildfile has a
script file
section tagged by +script. The
mkifs
parses this script, but it's executed by procnto at boot
time. It provides a very simple scripting environment, with the ability to run a
series of commands, and a small amount of synchronization.
- The embedded shell,
esh,
provides a scripting environment for running simple scripts in an embedded
environment where the overhead of the full ksh might be too much.
It supports the execution of utilities, simple redirection, filename expansion,
aliases, and environment manipulation.
- The fat embedded shell,
fesh,
provides the same limited environment as esh, but
supplies additional builtin commands for commonly used utilities to reduce the
overhead of including them in an embedded system. The fesh shell
includes builtins for
cp,
df,
ls,
mkdir,
rm,
and
rmdir,
although in most cases, the builtin provides only the core functionality of
the utility and isn't a complete replacement for it.
- The micro-embedded shell,
uesh,
provides a subset of esh's functionality, and is suitable for situations with
very limited memory.
- python
is a powerful object-oriented language that you can use for processing
files, manipulating strings, parsing HTML, and much more.
- sed
is a stream editor, which makes it most useful for performing repeated
changes to a file, or set of files. It's often used for scripts, or as a utility
within other scripts.
- gawk
(GNU awk) is a programming language for pattern matching
and working with the contents of files. You can also use it for scripting or call it
from within scripts.
- The Bazaar project on our Foundry 27 website
(http://community.qnx.com)
includes perl, which, like gawk, is
useful for working with files and patterns.
The name perl stands for Practical Extraction and Report Language.
In general, a shell script is most useful and powerful when working with the execution of
programs or modifying files in the context of the filesystem, whereas
sed, gawk, and perl are
primarily for working with the contents of files. For more information, see:
- the entries for
gawk
and
sed
in the Utilities Reference
- Robbins, Arnold, and Dale Dougherty. 1997. sed & awk, 2nd Edition.
Sebastopol, CA: O'Reilly & Associates. ISBN 1-56592-225-5
- Schwartz, Randal L., and Tom Phoenix. 2001. Learning Perl. Sebastopol,
CA: O'Reilly & Associates. ISBN 0-59600-132-0