-
- Weitere Informationen zu diesem Buch:
Inhaltsverzeichnis | Index | Probekapitel | Kolophon | Rezensionen |
Beispiele |
- Weitere Informationen zu diesem Buch:
Second Edition April 2002
ISBN 978-0-596-00195-7
Weitere Informationen zu diesem Buch
Inhaltsverzeichnis |
Index |
Probekapitel |
Kolophon |
Rezensionen |
Beispiele |
Index
[ Symbols ], [ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ], [ Y ], [ Z ]
Symbols[ Top ]
We'd like to hear your suggestions for improving our indexes. Send email to index@oreilly.com.
Symbols
& ampersand, 22
&& for condition tests, 230
&& in exit status syntax, 141-143
&& logical operator, 150
as bitwise operator, 183
(see also background jobs)
< > angle brackets, 209
<< >> bitwise operators, 183
in I/O redirection, 20
* asterisk, 15
for accessing entire array, 195
as built-in variable, 100
as command (vi-mode), 58
as default in case statement, 161
as regular expression operator, 114-118
as wildcard, 17
@ at sign
for accessing entire array, 195
as built-in variable, 100
as default list in for statement, 154
as default list in select statement, 165
for preserving whitespace, 196
as regular expression operator, 114, 117
\ backslash, 27
as command, 57
{ } curly braces, 105
[ ] square brackets, 118
[[...]] for comparison tests, 144-154
[...] for condition tests (old syntax), 144
set construct wildcards and, 16
^ caret character, 41
as bitwise operator, 183
as command, 48
matching beginning of line in regular expressions, 322
: colon, 21, 109-112
, comma, as command, 56
$ dollar sign
$@/$* variables, 100-104
$((...)), 183
as built-in variable, 36, 275
as command, 48
as pattern-substitution operator, 124
as variable name operator, 126
. dot
.. indicating parent of working directory, 11
indicating hidden files, 14
as redo command, 52
to run scripts, 91
indicating working directory, 11
= equal sign, 230
== string comparison operator, 144
as command, 58
as string comparison operator, 144
as variable assignment operator, 73
! exclamation point
!= string comparison operator, 144
as built-in variable, 275
indicating negation in character set, 16
as negation operator, 150, 152
as regular expression operator, 114, 117
<ga> grave accent, 127
# hash mark
## pattern-matching operator, 121, 123, 191
as built-in variable, 100
as command, 59
indicating comments, 111
as pattern-matching operator, 121, 123, 134, 169
size of arrays and, 196
- minus sign, 72, 277
as command, 54
( ) parentheses
((...)) for arithmetic expressions, 186
enclosing arithmetic expressions, 184
for subshells, 286
% percent sign
%% pattern-matching operator, 121, 134, 169, 190
as command, 56
as pattern-matching operator, 121-123, 158, 161
specifying jobs, 259-261, 265
| pipe, 21, 209
|& for two-way pipes, 283-286
|| for condition tests, 150
|| for exit statuses, 141-143
as bitwise operator, 183
as case pattern separator, 160
(see also pipelines)
+ plus sign, 72
as command, 54
as regular expression operator, 114, 117
? question mark
as built-in variable, 138
as regular expression operator, 114, 117
as wildcard, 15, 118
using with ERR fake signal, 296
" " quote marks, 27, 74, 242, 246
arithmetic expressions and, 183
secure shell scripts and, 331
single (' '), 26, 28, 242, 246
trap command and, 271
; semicolon
;& in case statement, 164
;; in case statement, 166
as command, 56
as statement separator, 69, 145, 316
~ tilde, 10
as bitwise operator, 183
as command, 59
(see also tilde notation)
_ underscore, as command, 59
Numbers
0 command, 48
A[ Top ]
-A option to read command, 233
-a option to ulimit command, 324
a/A commands, 50
a.out file, 148, 179
abbreviations for vi-mode delete commands, 51
Ada programming language, 109
adb debugger, 290
ADM-3a terminal, 54
AIX, 1
album collection task (see tasks, album collections, tracking)
algebraic notation, 284, 288
aliases, 66, 68-71, 210
in command-line processing, 240
customizations and, 326
defining, 68
in emacs-mode, 46
order of precedence in command lookup, 95
predefined, 368
recursive, 70
removing, 71
showing, 71
tracked, 84
in vi-mode, 59
ampersand (&), 22
&& for condition tests, 230
&& in exit status syntax, 141-143
&& logical operator, 150
as bitwise operator, 183
(see also background jobs)
angle brackets (< >), 209
<< >> bitwise operators, 183
in I/O redirection, 20
Apple, Macintosh OS X by, 257, 388
arguments, 7
arithmetic comparison operators, 153
arithmetic expressions, 177-193, 204
in command-line processing, 240
condition tests for, 186
operators for, 183-185
arithmetic facility, 374
arithmetic for loop, 203
arrays, 194-199
assignment with set -A, 203
associative, 197
extracting values from, 195
indexed, 194-197
initializing, 195, 203
size of, 196
ASCII character set, 16
assemblers, 147
assembly language, 147-149
associative arrays, 197
asterisk (*), 15
for accessing entire array, 195
as built-in variable, 100
as command (vi-mode), 58
as default in case statement, 161
as regular expression operator, 114-118
as wildcard, 17
at sign (@)
for accessing entire array, 195
as built-in variable, 100
as default list in for statement, 154
as default list in select statement, 165
for preserving whitespace, 196
as regular expression operator, 114, 117
AT&T, 4
AT&T UWIN, 365
awk command, 118, 245
using instead of cut, 129
using instead of pr -n, 308
vs. Korn shell, 117-119
B[ Top ]
b/B commands, 48
background jobs, 22-25, 93, 261
creating, 259
process IDs and, 275
saving standard output and error of, 215
with two-way pipes, 283
ways to refer to, 259-266
backreferences, 118
backslash (\), 27
as command, 57
backslash-escaping, 27
basename command, 123
bash shell, 5, 351-355
bc command, 284
Bell Laboratories, 4
bg command, 262
bgnice option, 72
coroutines and, 280
biff command, 76
/bin directory, 81
/bin/bsh, 321
/bin/sh, 321
bitwise operators, 183
blocks of code (see code blocks)
Bourne shell, 3-5, 33, 72, 338-341
command substitution and, 127
functions and, 94
installing Korn shell as, 321
Bourne, Stephen, 3
brace expansion, 240
brackets [ ], 118
[[...]] for comparison tests, 144-154
break statement, 166
breakpoints, 308
BSD, 1, 3, 47
pr -n and, 308
ps command and, 269
built-in commands
in command-line processing, 241
help for, 7
list of, 367
order of precedence in command lookup, 95
restricted shell and, 333
built-in variables, 75-86
(see also environment variables)
C[ Top ]
C command, 52
C compilers, 121, 147-149, 178-182
options for, 180
as pipelines, 251-254
-c option to ulimit command, 324
C programming language, 3, 17, 91, 186
vs. assembly language, 147
break statement and, 166
case statement and, 160
code blocks and, 229
for loop and, 154
while loop and, 167
C shell, 3-5, 132
command substitution and, 127
filename completion and, 42
history mechanism in, 33, 35, 60
pushd and popd commands in, 131
setuid shell scripts and, 335
C++ programming language, 254
caret character (^)
as bitwise operator, 183
as command, 48
matching beginning of line in regular expressions, 322
search commands and, 41
case statement, 136, 160-164
I/O redirection and, 228
shift command and, 175
syntax for, 160
case-changing commands (emacs-mode), 46
cat command, 19
kshdb debugging tool and, 302
sending email and, 275
cc command, 52
cd commands, 11
cd - and, 12
vs. stacks, 132
restricted shell and, 332
CDPATH variable, 85
central processing units (CPUs), 280
character sets, 16
character-based user interfaces, 1
character-finding commands, 55
characters, special (see special characters)
chmod command, 92
close system call, 279
code blocks, 229-231
piping output to, 230
redirecting standard I/O to, 229
vs. subshells, 287
code, examples of (see tasks)
colon (:), 109-112
separating fields, 21
COLUMNS variable, 75
comma (,), as command, 56
command completion, 42
command lines, 2, 7
command number, 78
command substitution, 34, 127-131
here-documents and, 212
I/O redirection within, 127
order in command-line processing, 240
shown in xtrace output, 292
command-line editing, 33-64
enabling, 34
command-line options, 172-182
list of, 366-379
command-line processing, 236-254
within condition tests, 144
effect of eval on, 248
effect of quoting on, 242
example of, 241
order of steps in, 238
commands, 7
in emacs-mode, 36-38
finding, 81-84
order of precedence for, 95, 238
tracked aliases and, 84
miscellaneous
in emacs-mode, 43-46
in vi-mode, 59
for navigating history file
in emacs-mode, 40
in vi-mode, 53-55
spanning more than one line, 29
in vi-mode, 48, 51-53
comment lines, filtering out with grep command, 230
comments in scripts, 111
compound statements, redirecting I/O to, 228
compound variables, 105-107
condition tests, 144-154, 183
arithmetic, 186, 188
integer values as truth values, 310
arithmetic comparison operators for, 153
file attribute operators for, 149-152, 251
old syntax for, 144
processing text within, 144
string comparison operators for, 144-149, 230
in while and until constructs, 168
conditionals (see if statement)
constants, setting up in shell scripts, 206
continue statement, 171
control keys, 30-32
editing-mode clashes with, 34
emacs-mode and, 36
finger habits and, 63
signals and, 263
control mode, 47
core dumps, 263, 272, 287, 325
coroutines, 258, 278-285
advantages/disadvantages of, 280
on multiple-CPU computers, 281-283
pipelines as example of, 278
with two-way pipes, 283-286
cp command, 20
CPUs (central processing units), 280
csh shell (see C shell)
.cshrc file, 89
setuid shell scripts and, 335
CTRL-\ command, 31, 287
signals and, 263
CTRL-A command, 40
CTRL-B command, 37
CTRL-C command, 31, 40
vs. CTRL-Z command, 261, 263
signals and, 263
suspending jobs with, 261
CTRL-D command, 31, 38, 275
caution with, 37
for ending shell sessions, 7
select loop and, 166
CTRL-E command, 40
CTRL-F command, 37
CTRL-H command, 31, 37
CTRL-J command, 43
CTRL-K command, 40
CTRL-L command, 43, 59
CTRL-M command, 30, 43
CTRL-N command, 40
CTRL-O command, 43
CTRL-P command, 40
CTRL-Q command, 31
CTRL-R command, 40
CTRL-S command, 31
CTRL-T command, 43
CTRL-U command, 31, 43
CTRL-V command, 43, 59
CTRL-W command, 43
CTRL-]x command, 43
CTRL-X CTRL-E command, 43
CTRL-X CTRL-X command, 43
CTRL-Y command, 37
retrieving words with, 39
CTRL-Z command, 261-263
signals and, 263
CTRL-@ command, 43
CTRL-[ command, 43
curly braces ({ }), 105
current directory (see working directory)
cursor, 45
cut command, 19, 21, 129
using to access user account information, 212
awk command and, 129, 245
-c (extract columns), 131
-d (field delimiter), 129
cygwin environment, 363
D[ Top ]
D command, 52
-d file attribute operator, 149, 169
-d option
to read command, 233
to ulimit command, 324
d$ command, 51
d0 command, 51
daemons, 269
Darwin, 388
data funnels, 20
date command, 20, 183
db/dB commands, 51
dc command, 284, 288
dd command, 52
DEBUG fake signal, 295, 298
kshdb limitations and, 313
debugger functions, 299, 304
debuggers, 179, 290
debugging
core dumps for, 325
options for, 291-294
turning on and off, 294
shell code, 291-320
(see also kshdb debugging tool)
default case (C programming language), 161
DEL command, 31, 36
delete buffer, 52
deleting elements, mark and, 45
deletion commands (vi-mode), 51-53
Desk Top Korn shell (dtksh), 347
/dev/null file, 142
dh command, 51
diff, 24, 137
directories, 9-14
home (login), 10
remembering, 131
dirname command, 123
dirs command, 131
DJGPP suite, 363
dl command, 51
dollar sign ($)
$@/$* variables, 100-104
$((...)), 183
as built-in variable, 36, 275
as command, 48
as pattern-substitution operator, 124
as variable name operator, 126
dot (.)
.. indicating parent of working directory, 11
indicating hidden files, 14
as redo command, 52
to run scripts, 91
indicating working directory, 11
double quotes (" "), 27, 74, 242, 246
arithmetic expressions and, 183
secure shell scripts and, 331
downloads, AT&T web site for, 387
driver script (kshdb debugging tool), 301
dtksh shell, 347
dup system call, 279
dw/dW command, 51
E[ Top ]
-e file attribute operator, 149, 156
-e option
to hist command, 61-63
to print command, 219
e/E commands, 48
EBCDIC character set, 16
echo command, 5, 73
using print command instead of, 218
ed line editor, 88, 211
editing (see command-line editing)
editing commands (vi-mode), 47
editing modes, 34
customizing, 327-329
EDITOR variable, 75, 88
-ef file attribute operator, 149
egrep command, 118
vs. Korn shell, 117-119
elif (see if statement)
else clause, 136
Emacs editor, 34, 36, 45, 87
finger habits and, 63
regular expressions and, 115
search commands and, 41
emacs option, 72
emacs-mode, 36-47
basic commands for, 36-38
case-changing commands for, 46
command subset for, 63
commands for (list), 376
customizations and, 326
enabling, 34
history commands for, 40
line commands for, 39
miscellaneous commands for, 43-46
terminal requirements for, 37
word commands for, 38
ENTER key/character, quoting, 29
ENV variable, 88
environment, 65-90
customizing, 323-327
hints for, 90
via programming, 91-134
(see also shells)
environment files, 34, 88
in shell subprocess, 286
system-wide unavailable to Korn shell, 326
environment variables, 34, 61, 87
creating, 87
customizations and, 326
displaying, 88
restricted shell and, 333
subprocess inheritance and, 286
visibility in shell subprocesses, 93
(see also built-in variables)
-eq arithmetic comparison operator, 153
equal sign (=), 230
== string comparison operator, 144
as command, 58
as string comparison operator, 144
as variable assignment operator, 73
ERR fake signal, 295-298
ESC commands, 39-43
/etc/hosts file, 229
/etc/passwd file, 21, 245
restricting user login shell and, 332
user account information and, 212
/etc/profile file, 67, 165
aliases defined in, 326
environment customization and, 323
/etc/suid_profile file, 335
/etc/termcap file, 80
eval command, 248-254
for constructing pipelines, 248, 251-254
exclamation point (!)
!= string comparison operator, 144
as built-in variable, 275
indicating negation in character set, 16
as negation operator, 150, 152
as regular expression operator, 114, 117
exec statement, kshdb debugging tool and, 302
exec system call, 279
executable files, 9, 81, 147
a.out file and, 148
in command-line processing, 241
order of precedence in command lookup, 95
renaming with mv command, 159
setuid bit and, 334-336
while loop and, 170
execution tracing, 310
exit command, 275
for ending shell sessions, 7
EXIT fake signal, 295
limitations and, 313
exit statuses, 137-143, 146
combining, 141-143
in job status messages, 259
trapping when non-zero, 296-298
export command, 87, 205
FPATH variable and, 327
expr command, 183
F[ Top ]
-f file attribute operator, 149
-f option, 205
to print command, 219
to typeset command, suboptions for, 206
to ulimit command, 324
-F option to ls command, 69
fake signals, 294-298
kshdb and, 313
fake traps, 327-329
false command, 271
fg command, 259-261
for resuming suspended jobs, 262
fi (see if statement)
file attribute operators, 149
file command, 170, 316
file descriptors, 210, 214-216
I/O redirection to/from, 209, 215, 232
filename completion
in emacs-mode, 42
in vi-mode, 57
filename expansion
in emacs-mode, 42
in vi-mode, 58
filename generation, 241
filenames, 14-18
files, 8
cleaning up, 275
environment, 88
executable (see executable files)
ls command for listing, 14
modification times of, 250
permissions for, 92, 323
printing information about, 151
temporary, 275
types of, 8
find command, 27
finger command, 155
finger habits, 63
flow control, 135-171
summary of constructs for, 136
for loop, 136, 154-160
arithmetic, 203
lists of names in, 154
syntax for, 154
foreground jobs, 23
fork system call, 279
Fortran programming language, 153
FPATH variable, 327
from command, 89
-ft option to typeset command, 294
full pathnames, 10
functions, 94-99, 206
in command-line processing, 241
deleting, 94
local variables in, 200
order of precedence in command lookup, 95
recursive, 288
syntax for, 94
system-wide, 327
tracing execution of, 206, 294
fx/Fx commands, 56
G[ Top ]
G command, 54
-G file attribute operator, 149
gdb/dbx debuggers, 325
-ge arithmetic comparison operator, 153
getopts command, 176, 183
using, 379-385
GNU Emacs, 44
GNU/Linux, 1
Gosling (Unipress) Emacs, 43
graphical user interfaces (GUIs), 1, 285
grave accent (<ga>), 127
greedy/non-greedy matching, 125
grep command, 19
exit status and, 142
filtering out comment lines with, 230
-i option for, 131
group leaders, 267
-gt arithmetic comparison operator, 153
GUIs (graphical user interfaces), 1, 285
gunzip command, 23
gzip command, 23
H[ Top ]
h command, 48
hangup (HUP), 276
hard/soft limits, 325
hash mark (#)
## pattern-matching operator, 121, 123, 191
as built-in variable, 100
as command, 59
indicating comments, 111
as pattern-matching operator, 121, 123, 134, 169
size of arrays and, 196
head command, 188
string operators and, 110
header lines, extracting, 211
help, 7
here-documents, 211-213
deleting leading TABs in, 213
hidden files, 14, 66
hist command, 33, 35, 60-63
-l option to, 62
HISTCMD variable, 79
HISTEDIT variable, 61, 75
HISTFILE variable, 35, 75, 87
history alias, 61
history file, 35
navigating
in emacs-mode, 40
in vi-mode, 53-55
printing to, 220
history mechanism, in C shell, 33, 35, 60
HISTSIZE variable, 36
HOME variable, 86
using to replace tilde, 240
hostname command, 128
HP-UX, 1
--html option for HTML output, 8
HUP (hangup), 276
I[ Top ]
-i option, 206
to grep command, 131
to typeset command, 205
i/I commands, 50
I/O, 18
background jobs and, 23
break conditions and, 310
file redirection and, 189
two-way pipes and, 283
I/O redirection, 20, 209-216
to code blocks, 229
with exec statement, 302
to/from file descriptors for, 209, 215, 232, 235
to multiline flow-control constructs, 228
order of in command-line processing, 241
restricted shell and, 333
if statement, 136-154, 192, 204
I/O redirection and, 228
syntax for, 136
IFS variable, 100, 102, 236
read command and, 225
role in command-line processing, 240
ignoreeof option, 72
customizations and, 326
indexed arrays, 194-197
indirect variable references, 107
input (see entries at I/O)
input mode, 47
entering, 50
INT signal, 264, 276
trap on, 273
integer comparison operators, 153
internal field separator (see IFS variable)
Internet, 211
interprocess communication (IPC), 263
invocation options, 366-379
J[ Top ]
j command, 54
job control, 259-263
job numbers, 258-260, 288
jobs, 258-263, 288
background (see background jobs)
priority assigned to, 24
resuming, 262
suspending, 261
ways to refer to, 259-265, 272
(see also processes)
jobs command, 23
-p option for, 266
vs. ps command, 267
Joy, Bill, 3
K[ Top ]
k command, 54
KEYBD fake signal, 295, 327-329
keywords
in command-line processing, 238
list of, 367
order of precedence in command lookup, 95
kill command, 264-266, 269
-l option to, 263
process IDs and, 268
KILL signal, 264, 266
Korn shell
1988 version, 341-344
1993 version, 4-6, 390-396
vs. awk/egrep regular expressions, 117-119
building from source code, 386-389
customizing, 321
options for invoking (list), 366-379
security for, 321, 329-336
versions/features of, ix, 5
Korn, David, 4, 386
ksh shell (see Korn shell)
ksh88, 341-344
ksh93, 4-6
source code license agreement for, 390-396
kshdb debugging tool, 290, 301-320
commands for, 305-312
limitations of, 312
sample session of, 313-315
source code for, downloading, 301
.kshrc file, 89
L[ Top ]
l command, 48
-L file attribute operator, 149
-l option
to hist command, 60
to jobs command, 260
to kill command, 263
to ls command, 14
-L string formatting option, 203
-l string formatting option, 204
-le arithmetic comparison operator, 153
left angle bracket (<), 209
length operators, 126
let command, 187-192
(see also arithmetic expressions)
LINENO variable, 293, 297
LINES variable, 75
linkers/linking, 147-149
C compilers and, 179
case statement and, 161
LISP programming language, 18, 137
locales, 16
login name, prompts and, 78
LOGNAME variable, 87
logout file, 68
lp command, 10, 21
ls command, 14
-F option for, 69
-l option for, 130
-lt arithmetic comparison operator, 153
M[ Top ]
-m option to ulimit command, 324
Macintosh OS X (Apple), 257, 388
macros
in emacs-mode, 46
in vi-mode, 59
mail command, 274
mail program, 76-78, 87, 275-278
sending messages from, 129
MAIL variable, 76
MAILCHECK variable, 76
MAILPATH variable, 76-78, 82
make utility, 250
man command, 92, 269
--man option for printing help articles, 8
man pages, 8
mark (emacs-mode), 45
markdirs option, 72
metacharacters, 238
Microsoft Windows, 15, 257
minus sign (-), 72
as command, 54
for trap command, 277
mkfifo command, 263
MKS Toolkit, 364
Modula programming language, 109
more command, 21, 80
MS-DOS, 15, 63
filename format for, translating to Unix-friendly format, 157-159
multitasking and, 257
multitasking, 257
mv command, 159, 276
C compilers and, 179
N[ Top ]
-n option
to jobs command, 260
to print command, 113, 152, 204, 219
to read command, 233
to sort command, 2
to ulimit command, 324
-n string comparison operator, 144, 165
n/N commands, 54
namerefs, 107
-ne arithmetic comparison operator, 153
nice command, 25
noclobber option, 72, 211
customizations and, 326
noexec option, 292, 294
noglob option, 72
nohup command, 277
non-greedy matching, 125
--nroff option for command help, 8
-nt file attribute operator, 149, 251
null string, 101
numeric variables, 177-193
numerical order, -n option for, 2
O[ Top ]
-O file attribute operator, 149
object-code libraries, 179
C runtime library and, 180, 182
octal notation, 323
OLDPWD variable, 86, 132
OpenVMS, 15, 22
filenames and, 115
multitasking and, 257
OPTARG variable, 177
OPTIND variable, 177
options, 7, 66, 71-73
command-line (see command-line options)
emacs, 35
keyword, 87
processing with arguments, 175
turning on/off, 72
vi, 35
orphans, 269, 279
-ot file attribute operator, 149
otherwise case (Pascal-derived languages), 161
output (see entries at I/O)
P[ Top ]
-p option
to jobs command, 260, 266
to print command, 219, 283, 285
to read command, 233, 283, 285
to ulimit command, 324
to whence command, 127
p/P commands, 52
parallelizing shell scripts, 281-283
parameter substitution, 212
parameters (see arguments)
parameters, positional (see positional parameters)
parent process ID (PPID), 275
parentheses ( )
((...)) for arithmetic expressions, 186
enclosing arithmetic expressions, 184
grouping condition tests, 150
for subshells, 150, 286
Pascal programming language, 91, 100, 109
case statement and, 160
for loop and, 154
until condition and, 167
while loop and, 167
PATH variable, 81-84, 87
security problems with, 83
pathnames
full/relative, 10
restricted shell and, 333
pattern matching, 119
pattern-matching operators, 121-123, 169, 190
syntax for, 121
pattern-substitution operators, 123-125
patterns, 113-123
PCs, 80
Korn shell emulation for, 363-365
pdksh shell, 350
percent sign (%)
%% pattern-matching operator, 121, 134, 169, 190
as command, 56
as pattern-matching operator, 121-123, 158, 161
specifying jobs, 259-261, 265
performance
optimizing C compliers and, 180
processes and, 280
permissions, 92
pipe (|), 21, 209
|| for condition tests, 150
|| for exit statuses, 141-143
as bitwise operator, 183
as case pattern separator, 160
(see also pipelines)
pipe system call, 279
pipelines, 21, 238
to code blocks, 230
system calls used in, 278
two-way, 283-286
plus sign (+), 72
as command, 54
as regular expression operator, 114, 117
point (place location), 37
mark and, 45
popd command, 131-134, 145
customizations and, 327
popd function, 189-193
additional arguments for, 189
popping, 131-134
Portable Operating System Interface (see POSIX)
positional parameters, 100-104, 172, 293, 303
in functions, 101
number of, 100
syntaxes for, 104
POSIX, 344-347
character class additions and, 116
PPID variable, 275
pr, using awk instead of pr -n, 308
preamble, 303
predefined aliases, 368
print command, 26, 73, 218-220
as debugging aid, 291
for emulating eval, 248
escape sequences for, 219
-n option for, 113, 152, 204
options for, 219
-p option for, 283, 285
priority, 24
privileged mode, 335
process IDs, 258
printing, 288
variables for, 275
process substitution, 240
processes, 257
group leaders, 269
in pathological states, 269, 279
performance and, 280
(see also jobs)
.profile file, 66
vs. environment file, 89
restricted shell and, 333
programming, 91-134
prompts, 78, 232
customizing
with current directory, 243-246
with machine name, 128
tildize function and, 245
ps command, 266-269, 288
vs. jobs command, 267
PS1 variable, 78, 128
customizations and, 326
quoting and, 243-246
PS2 variable, 78
PS3 variable, 78, 166
PS4 variable, 78, 293, 305
public domain Korn shell (pdksh), 350
pushd command, 131-134
customizations and, 327
improving upon, 137, 150
pushd function, 189-193
additional arguments for, 189
pushing, 131-134
PWD variable, 79, 86
Q[ Top ]
question mark (?)
as built-in variable, 138
as regular expression operator, 114, 117
as wildcard, 15, 118
using with ERR fake signal, 296
QUIT signal, 264-266
quote marks (" "), 27, 74, 242, 246
arithmetic expressions and, 183
secure shell scripts and, 331
(see also single quotes)
quoting, 26-29, 242
character strings, rules for, 183
command substitution with double quotes, 127
extended, 246
variables and, 74
R[ Top ]
r alias, 62
-r file attribute operator, 149
r/R commands, 50
-r/R options, 205
to print command, 219
to read command, 233
RANDOM variable, 296
read command, 225-234
options for, 233, 235
-p option for, 283, 285
-s option for, 306
syntax for, 225
for user input, 231-233
readonly command, 206
redo command, 52
reference appendix, 366-385
regexp operators, 113
regular expressions, 113-120
vs. awk and egrep, 116-118
in command-line processing, 241
operators for, 114
pattern matching with, 119
syntax for, 114
wildcards and, 113, 118
relative pathnames, 10
repeat counts, 44, 48
REPLY variable
in read statement, 226
in select statement, 165, 167, 196
resources for further reading
Emacs editor, 34
regular expressions, 113
Unix security, 336
vi editor, 34
resources, controlling with ulimit command, 324-326
restricted shell, 332
return statement, 139
Reverse Polish Notation (RPN), 284, 288
right angle bracket (>), 209
rksh shell, 332
rm command, 275
root user, 9, 325
RPN (Reverse Polish Notation), 284, 288
runaway processes, terminating with, 268
S[ Top ]
-s file attribute operator, 149
-s option
to hist command, 62
to print command, 220
to read command, 233, 306
to ulimit command, 324
s/S commands, 52
scripts, 91-94
built-in commands implemented as, 92
in command-line processing, 241
comments in, 111
order of precedence in command lookup, 95
SECONDS variable, 86
security, 329-336
PATH variable and, 83
restricted shell for, 332
sed command, 19
select statement, 136, 164-167
I/O redirection and, 228
syntax for, 164
semicolon (;)
;& in case statement, 164
;; in case statement, 166
as command, 56
as statement separator, 69, 145, 316
set command, 103, 195, 203
set construct wildcards, 16
set +o command, 72, 291-294
set -o command, 72, 291-294
options for (list), 372
privileged mode and, 335
set user ID, 334-336
setuid shell scripts, 334-336
caution with, 335
sh shell (see Bourne shell)
.sh_history file, 35
shell compilers, 290
shell subprocesses, 92-94, 286-288
inheritance and, 286
SHELL variable, 86
shell variables, 72-86, 99-105
list of, 369
naming conventions for, 73
shells, 1-18, 337-365
customizing, 65-90
hints for, 90
via programming, 91-134
installing Korn shell as standard, 321
using interactively, 7
options for, 71
shift command, 173-175, 177
signals, 259, 263-268
fake (see fake signals)
ignoring, 276
obtaining list of, 263
sending with control keys, 263
shell subprocesses and, 286
specifying in trap command, 271
single quotes (' '), 26, 28, 242, 246
trap command and, 271
sleep command, 271
SNOBOL programming language, 100
soft/hard limits, 325
Solaris, 1
sort command, 19-22
background jobs and, 23
-n option to, 2
string operators and, 110
space command, 48
special characters, 25-28, 104
(see also wildcards)
spell command, 92
square brackets [ ], 118
[[...]] for comparison tests, 144-154
[...] for condition tests (old syntax), 144
stacks, 131
standard I/O (see entries at I/O)
stepping, 307
?string command, 54
/string command, 54
string comparison operators, 144
string I/O, 218-236
string operators, 108-127
syntax for, 109-113
stty command, 30, 264
subprocesses, 86-89
subshells, 286-288, 313
sudo program, 336
SunOS, 1
superuser, 325
switch statement (C programming language), 160
symbolic links, 9, 12-14
symbols (see special characters; wildcards)
system calls, 278
System V
pr -n and, 308
ps command and, 267
Release 4 of, 4
T[ Top ]
-t option
to read command, 233
to ulimit command, 324
TAB command, 42
tail command, 160
tasks, xii, 91
album collections, tracking, 110
fields/columns for, 128
background jobs, killing, 266
calculator program, writing, 284
email
composer for, 274
sending to users, 129, 212
files
contents of two, printing side-by-side, 235
finding by modification date, 130
information about, printing, 151
size of output in, 188
translating names from MS-DOS to Unix-friendly format, 157
front-end for C compiler
compile source files and, 281
using Korn shell script as, 122
header lines, extracting, 211
log files, creating, 215
logged on users, identifying, 155
ls command, multicolumn output for, 203
make utility, implementing, 250
numbers on command line, adding, 193
pathnames, removing directory prefix from, 123
prompt string, customizing, 243
stacks, implementing, 131
terminal type, identifying, 162
cleaner solution for, 196
whence command, writing simplified version of, 168
TCP/IP networks, 229
tee command, 215
temporary files, 275
TERM signal, 264-266, 272, 276
TERM variable, 80, 87
for identifying terminal type, 162
cleaner solution for, 196
select statement and, 165-167
termcap, 80
terminal type, identifying, 162
cleaner solution for, 196
terminfo, 80, 166
test command, 144
test operators, list of, 371
tests (see condition tests)
text editors, 80
text files (see files)
text, changing in input mode, 50
Thompson Automation Software Toolkit, 364
Thompson shell, 113
thrashing, 280
tilde (~), 10
as bitwise operator, 183
as command, 59
tilde notation, 10, 17, 244
tildize function, 245
tksh shell, 349
TMOUT variable
customizations and, 326
in read statement, 235
in select statement, 167
/tmp directory, 275, 302
tokens, 238
TOPS-20, filename completion and, 42
in vi-mode, 57
tr command, 19, 157, 204
trackall option, 72
transpose characters command, 44
trap command, 270-272
ignoring signals and, 276
resetting traps and, 277
syntax for, 271
traps, 270-278
before every statement, 298
for fake signals, 294-298, 304, 306
within functions, 272-274
for ignoring signals, 276
resetting, 277
shell subprocesses and, 286
trojan horses, 333
true command, 271
TSTP signal, 264
tty, 162
two-way pipes, 283-286
vs. standard pipes, 285
tx/Tx commands, 56
typeset command, 200-208
-ft option for, 294
function options for, 206
kshdb limitations and, 313
using to make variables local to functions, 102
with no arguments, 207
options for
list of, 373
turning off, 203
string formatting options for, 202-205, 235
syntax for, 200
type and attribute options for, 205-208
U[ Top ]
-u option
to print command, 219
to read command, 233
u/U commands, 52
ulimit command, 324-326
umask command, 323
unalias command, 71
underscore (_), as command, 59
Unipress Emacs, 43
Unix
Command Syntax Standard Rules for, 176, 178
Programmer's Manual for, 258, 269
ps command and, 266
signals and, 263
utilities for, 19
versions of, viii, 1, 3
Unix man pages, 8
Unix System Laboratories (USL), 4
Unix terminal interface, 44
control key clashes and, 34
until condition, 136, 167, 171
I/O redirection and, 228
syntax for, 168
vs. while loop, 168
URLs
AT&T Labs-Research, 387
AT&T UWIN, 365
bash shell, download for, 351
cygwin environment, 363
DJGPP suite, 364
dtksh presentation, 348
Free Software Foundation, 351
IEEE, 345
Korn shell home page, 386
kshdb debugging tool, download for, 301
Linux Journal, 348
MKS Toolkit, 364
NetBSD, 388
OpenBSD, 388
pdksh, download for, 350
Purdue University's Center for Education and Research in Information Assurance and Security, 329
Specialized Systems Consultants, Inc., xvi
sudo program, 336
for this book, 301
Thompson Automation Software Toolkit, 364
tksh home page, 349
zsh shell, download for, 355
user interfaces, 1
user-controlled multitasking, 257
username, prompts and, 78
USL (Unix System Laboratories), 4
/usr/bin directory, 81
/usr/lib directory, 302
V[ Top ]
v command, 59
-v option
to ulimit command, 324
to whence command, 95, 316
variable name operators, 126
variables, 66, 72-86
appending new value to, 105
built-in, 73-86
in command-line processing, 240
compound, 105-107
defining, 73
deleting, 73
environment (see environment variables)
floating-point, 186-189
global, 101
integer, 186-192, 206
in Korn shell vs. conventional programming languages, 100
listing, 207
local (in functions), 101, 200
manipulating indirectly, 107
numeric, 177-193
quoting rules and, 74
shell (see shell variables)
value of
full syntax for, 104
short form for, 73
verbose option, 291
Version 7, 3
vi editor, 34, 47, 87
vi option, 72
vi-mode, 47-60
case-changing command for, 59
character-finding commands for, 55-57
commands for (list), 377
control mode commands for, 48
customizations and, 326
cut and paste commands for, 52
deletion commands for, 51-53
enabling, 34
entering/changing text in, 50
history file, navigating in, 53-55
miscellaneous commands for, 59
undelete commands for, 52
VISUAL variable, 34, 75
VM/CMS, 22
multitasking and, 257
VT100 terminal, 80
W[ Top ]
-w file attribute operator, 149
w/W commands, 48
wait system call, 279
watchpoints, 310
wc utility, 189
weak quotes (" "), 27, 74
whence command, 34
-p option for, 127
-v option for, 95, 316
writing simplified version of, 168
while loop, 136, 167-171
comment lines and, 230
I/O redirection and, 228
illustrating $((...)) mechanism, 190
syntax for, 168
vs. until condition, 168
whitespace, preserving in arrays, 196
who command, 130
wildcard expansion, 17
wildcards, 14-18
in alias expansions, 70
expansion of in command-line processing, 241
regular expressions and, 113, 118
types of, 14
Windows (Microsoft), 15, 257
words, 2
in command-line processing, 238
in vi-mode, 48
working directory, 10
changing, 11
prompts and, 78
X[ Top ]
@x command, 59
-x file attribute operator, 149, 169
-x option, 205
X Window System, 36, 80
x/X commands, 52
xterm, 36, 80
xtrace option, 292-294
Y[ Top ]
y command, 52
y.tab.c file, 122
Z[ Top ]
-z string comparison operator, 144-146
zombies, 269
zsh shell, 355-363
Zurück zu Learning the Korn Shell