Invoking the Shell (UNIX in a Nutshell: System V Edition)
4.7. Invoking the Shell
The command interpreter for the Bourne shell (sh)
or the Korn shell (ksh) can be invoked as follows:
sh [options] [arguments]
ksh [options] [arguments]
ksh and sh can execute commands from a terminal,
from a file (when the
first argument is an executable script), or
from standard input (if no arguments remain or if -s
is specified).
ksh and sh automatically print prompts if
standard input is a terminal, or if -i is
given on the command line.
ArgumentsArguments are assigned in order to the positional parameters
$1, $2, etc. If array assignment is in effect
(-A or +A), arguments are assigned as array
elements. If the first argument is an executable script,
commands are read from it, and the remaining arguments are assigned
to $1, $2, etc.
Options
-c strRead commands from string str.
-DPrint all $"..." strings in the program.
ksh93 only.
-iCreate an interactive shell (prompt for input).
-I fileCreate a cross-reference database for variable and command
definitions and references.
May not be compiled in.
ksh93 only.
-pStart up as a privileged user (Bourne shell:
don't set the effective user and group IDs
to those of the real user and group IDs.
Korn shell:
don't process $HOME/.profile).
-rCreate a restricted shell (same as rksh or rsh).
-sRead commands from standard input;
output from built-in commands goes to file descriptor 1;
all other shell output goes to file descriptor 2.
The remaining options to sh and ksh are
listed under the set built-in command.
4.6. Job Control4.8. Restricted Shells
Copyright © 2003 O'Reilly & Associates. All rights reserved.
Wyszukiwarka
Podobne podstrony:
ch04ch04 (13)ch04 (2)ch04ch04ch04ch04ch04ch04ch04 (4)ch04ch04CH04 (11)ch04ch04ch04ch04ch04więcej podobnych podstron