1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506
|
a
end-1
a
end-2
a:x
end-a
b:x
end-b
c:x
end-c
end-3
a:x
end
a
b
c
end-1
a
b
c
end-2
a:x
a:y
a:z
end-a
b:x
b:y
b:z
end-b
c:x
c:y
c:z
end-c
end-3
a:x
b:x
c:x
end
$BVAR
$BVAR
$BVAR
$BVAR
foo
bar
xxx
0022
u=rwx,g=rx,o=rx
0002
u=rwx,g=rwx,o=rx
umask 0002
umask -S u=rwx,g=rwx,o=rx
u=rwx,g=rwx,o=rwx
enable .
enable :
enable break
enable continue
enable eval
enable exec
enable exit
enable export
enable readonly
enable return
enable set
enable shift
enable source
enable times
enable trap
enable unset
enable .
enable :
enable break
enable continue
enable eval
enable exec
enable exit
enable export
enable readonly
enable return
enable set
enable shift
enable source
enable times
enable trap
enable unset
enable -n test worked
enable -n test
enable test worked
./builtins.tests: line 126: enable: notbuiltin: not a shell builtin
./builtins.tests: line 127: enable: test: not dynamically loaded
specialname
-specialname
FOO=BAR
FOO=BAR
hash: hash table empty
0
no-newline
AVAR
foo
in source.sub2, calling return
5
a b c
a b c
x y z
a b c
a b c
m n o p
a b c
m n o p
/tmp/bash-dir-a
/tmp/bash-dir-a
/tmp/bash-dir-a
/
./source5.sub: line 23: /tmp/source-notthere: No such file or directory
after bad source 1
./source5.sub: line 30: /tmp/source-notthere: No such file or directory
one - OK
0
0
two - OK
0
three - OK
0
four - OK
0
abc
def
ghi
after
one.1 subshell
two.1 subshell
three.1 subshell
four.1 subshell
one.2 subshell
two.2 subshell
three.2 subshell
four.2 subshell
x29 - done
abc
def
ghi
ok
./source8.sub: line 40: improbable-filename: No such file or directory
./source8.sub: line 41: improbable-filename: No such file or directory
an improbable filename
an improbable filename
an improbable filename
an improbable filename
file in the current directory
./source8.sub: line 55: .: cwd-filename: file not found
file in the current directory
bash: line 1: .: cwd-filename: file not found
bash: line 1: .: cwd-filename: file not found
file in the current directory
file in the current directory
AVAR
foo
foo
AVAR
foo
foo
AVAR
foo
declare -x foo=""
declare -x FOO="\$\$"
./builtins.tests: line 242: declare: FOO: not found
declare -x FOO="\$\$"
ok
ok
./builtins.tests: line 274: kill: 4096: invalid signal specification
1
a\n\n\nb
a
b
-p
a b c
before: f = 4
inside
after: f = 8 bar = 4
declare -a c
declare -A d
declare -a c=([0]="4")
declare -A c=([0]="4" )
declare -a c=([0]="1" [1]="2" [2]="3")
declare -A c=([two]="2" [three]="3" [one]="1" )
declare -a c=([0]="1" [1]="2" [2]="3")
declare -a c=([0]="1" [1]="2" [2]="3")
unset
unset
assoc 1 unset
array 1 unset
assoc 2 unset
array 2 unset
unset1
unset2
1
1
1
1
0
0
assoc A unset
array a
assoc A
array a
assoc B unset
array b unset
assoc B unset
array b unset
scalar 1
scalar 2
scalar 3 unset
argv[1] = <one two three>
assoc: 3
array: 3
scalar: 13
scalar: 1
scalar: 0
scalar: 1
scalar: 0
scalar: 0
all set:
one
two
f1 ()
{
echo f1
}
f2 ()
{
echo f2
}
all unset:
unset1
unset2
./builtins6.sub: line 41: declare: f1: not found
./builtins6.sub: line 41: declare: f2: not found
all reset:
one-one
two-one
f1 ()
{
echo f1
}
f2 ()
{
echo f2
}
vars unset:
unset1
unset2
f1 ()
{
echo f1
}
f2 ()
{
echo f2
}
funcs unset:
one-two
two-two
bash: line 1: notthere: No such file or directory
one
bash: line 1: notthere: No such file or directory
two
bash: line 1: .: notthere: file not found
one
bash: line 1: .: notthere: file not found
0
0
0
0
argv[1] = <one>
0
argv[1] = <two>
0
three
0
four
0
./builtins7.sub: line 19: : command not found
127
0
./builtins7.sub: line 27: notthere: No such file or directory
after 1
./builtins7.sub: line 28: notthere: No such file or directory
after 2
type is a shell builtin
+ command -v type
type
+ command command -v type
type
+ command -p command -v type
type
+ command -p -- command -v type
type
+ set +x
u=rw,g=rx,o=rx
u=r,g=rx,o=rx
u=rwx,g=rwx,o=
u=rw,g=wx,o=rx
u=rx,g=rx,o=rx
u=rwx,g=rx,o=rwx
u=rwx,g=rwx,o=rx
u=rx,g=rx,o=rx
u=rwx,g=rx,o=rx
u=rwx,g=rwx,o=rwx
u=rwx,g=rwx,o=rwx
u=rwx,g=rx,o=rx
u=rwx,g=rx,o=rx
u=rwx,g=rx,o=rx
u=rwx,g=rx,o=rx
u=rwx,g=rx,o=rx
u=rwx,g=rx,o=rx
u=rwx,g=rx,o=x
hash: hash table empty
./builtins9.sub: line 19: hash: notthere: not found
1
/nosuchdir/nosuchfile
builtin hash -p /nosuchdir/nosuchfile cat
builtin hash -p /nosuchdir/nosuchfile cat
./builtins9.sub: line 30: hash: notthere: not found
./builtins9.sub: line 32: hash: notthere: not found
./builtins9.sub: line 33: hash: notthere: not found
1
./builtins9.sub: line 40: /nosuchdir/nosuchfile: No such file or directory
127
/nosuchdir/nosuchfile
0
0
found
./builtins9.sub: line 52: hash: /: Is a directory
builtin hash -p /nosuchfile cat
./builtins10.sub: line 17: help: -x: invalid option
help: usage: help [-dms] [pattern ...]
These shell commands are defined internally. Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.
A star (*) next to a name means that the command is disabled.
! PIPELINE history [-c] [-d offset] [n] or hist>
job_spec [&] if COMMANDS; then COMMANDS; [ elif C>
(( expression )) jobs [-lnprs] [jobspec ...] or jobs >
. [-p path] filename [arguments] kill [-s sigspec | -n signum | -sigs>
: let arg [arg ...]
[ arg... ] local [option] name[=value] ...
[[ expression ]] logout [n]
alias [-p] [name[=value] ... ] mapfile [-d delim] [-n count] [-O or>
bg [job_spec ...] popd [-n] [+N | -N]
bind [-lpsvPSVX] [-m keymap] [-f file> printf [-v var] format [arguments]
break [n] pushd [-n] [+N | -N | dir]
builtin [shell-builtin [arg ...]] pwd [-LP]
caller [expr] read [-Eers] [-a array] [-d delim] [>
case WORD in [PATTERN [| PATTERN]...)> readarray [-d delim] [-n count] [-O >
cd [-L|[-P [-e]]] [-@] [dir] readonly [-aAf] [name[=value] ...] o>
command [-pVv] command [arg ...] return [n]
compgen [-V varname] [-abcdefgjksuv] > select NAME [in WORDS ... ;] do COMM>
complete [-abcdefgjksuv] [-pr] [-DEI]> set [-abefhkmnptuvxBCEHPT] [-o optio>
compopt [-o|+o option] [-DEI] [name .> shift [n]
continue [n] shopt [-pqsu] [-o] [optname ...]
coproc [NAME] command [redirections] source [-p path] filename [argument>
declare [-aAfFgiIlnrtux] [name[=value> suspend [-f]
dirs [-clpv] [+N] [-N] test [expr]
disown [-h] [-ar] [jobspec ... | pid > time [-p] pipeline
echo [-neE] [arg ...] times
enable [-a] [-dnps] [-f filename] [na> trap [-Plp] [[action] signal_spec ..>
eval [arg ...] true
exec [-cl] [-a name] [command [argume> type [-afptP] name [name ...]
exit [n] typeset [-aAfFgiIlnrtux] name[=value>
export [-fn] [name[=value] ...] or ex> ulimit [-SHabcdefiklmnpqrstuvxPRT] [>
false umask [-p] [-S] [mode]
fc [-e ename] [-lnr] [first] [last] o> unalias [-a] name [name ...]
fg [job_spec] unset [-f] [-v] [-n] [name ...]
for NAME [in WORDS ... ] ; do COMMAND> until COMMANDS; do COMMANDS-2; done
for (( exp1; exp2; exp3 )); do COMMAN> variables - Names and meanings of so>
function name { COMMANDS ; } or name > wait [-fn] [-p var] [id ...]
getopts optstring name [arg ...] while COMMANDS; do COMMANDS-2; done
hash [-lr] [-p pathname] [-dt] [name > { COMMANDS ; }
help [-dms] [pattern ...]
help: help [-dms] [pattern ...]
shift - Shift positional parameters.
shift: shift [n]
Shift positional parameters.
Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is
not given, it is assumed to be 1.
Exit Status:
Returns success unless N is negative or greater than $#.
builtin: builtin [shell-builtin [arg ...]]
shift: shift [n]
Shell commands matching keyword `read*'
read: read [-Eers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]
readarray: readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
readonly: readonly [-aAf] [name[=value] ...] or readonly -p
read: read [-Eers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]
readarray: readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]
readonly: readonly [-aAf] [name[=value] ...] or readonly -p
:: :
Null command.
No effect; the command does nothing.
Exit Status:
Always succeeds.
NAME
: - Null command.
SYNOPSIS
:
DESCRIPTION
Null command.
No effect; the command does nothing.
Exit Status:
Always succeeds.
SEE ALSO
bash(1)
IMPLEMENTATION
Copyright (C) 2025 Free Software Foundation, Inc.
These shell commands are defined internally. Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.
A star (*) next to a name means that the command is disabled.
! PIPELINE history [-c] [-d offset] [n] or hist>
job_spec [&] if COMMANDS; then COMMANDS; [ elif C>
(( expression )) jobs [-lnprs] [jobspec ...] or jobs >
. [-p path] filename [arguments] kill [-s sigspec | -n signum | -sigs>
: let arg [arg ...]
[ arg... ] local [option] name[=value] ...
[[ expression ]] logout [n]
alias [-p] [name[=value] ... ] mapfile [-d delim] [-n count] [-O or>
bg [job_spec ...] popd [-n] [+N | -N]
bind [-lpsvPSVX] [-m keymap] [-f file> printf [-v var] format [arguments]
break [n] pushd [-n] [+N | -N | dir]
builtin [shell-builtin [arg ...]] pwd [-LP]
caller [expr] read [-Eers] [-a array] [-d delim] [>
case WORD in [PATTERN [| PATTERN]...)> readarray [-d delim] [-n count] [-O >
cd [-L|[-P [-e]]] [-@] [dir] readonly [-aAf] [name[=value] ...] o>
command [-pVv] command [arg ...] return [n]
compgen [-V varname] [-abcdefgjksuv] > select NAME [in WORDS ... ;] do COMM>
complete [-abcdefgjksuv] [-pr] [-DEI]> set [-abefhkmnptuvxBCEHPT] [-o optio>
compopt [-o|+o option] [-DEI] [name .> shift [n]
continue [n] shopt [-pqsu] [-o] [optname ...]
coproc [NAME] command [redirections] source [-p path] filename [argument>
declare [-aAfFgiIlnrtux] [name[=value> suspend [-f]
dirs [-clpv] [+N] [-N] test [expr]
disown [-h] [-ar] [jobspec ... | pid > time [-p] pipeline
echo [-neE] [arg ...] times
enable [-a] [-dnps] [-f filename] [na> trap [-Plp] [[action] signal_spec ..>
eval [arg ...] true
exec [-cl] [-a name] [command [argume> type [-afptP] name [name ...]
exit [n] typeset [-aAfFgiIlnrtux] name[=value>
export [-fn] [name[=value] ...] or ex> ulimit [-SHabcdefiklmnpqrstuvxPRT] [>
false umask [-p] [-S] [mode]
fc [-e ename] [-lnr] [first] [last] o> unalias [-a] name [name ...]
fg [job_spec] unset [-f] [-v] [-n] [name ...]
for NAME [in WORDS ... ] ; do COMMAND> until COMMANDS; do COMMANDS-2; done
for (( exp1; exp2; exp3 )); do COMMAN> variables - Names and meanings of so>
function name { COMMANDS ; } or name > wait [-fn] [-p var] [id ...]
getopts optstring name [arg ...] while COMMANDS; do COMMANDS-2; done
hash [-lr] [-p pathname] [-dt] [name > { COMMANDS ; }
help [-dms] [pattern ...]
./builtins10.sub: line 39: help: no help topics match `bash'. Try `help help' or `man -k bash' or `info bash'.
unlimited
unlimited
./builtins11.sub: line 27: ulimit: +1999: invalid number
0
0
./builtins11.sub: line 37: ulimit: -g: invalid option
ulimit: usage: ulimit [-SHabcdefiklmnpqrstuvxPRT] [limit]
./builtins11.sub: line 39: ulimit: max user processes: cannot modify limit: Operation not permitted
/tmp /bin
/tmp /bin
/bin /tmp
./builtins12.sub: line 21: pushd: -x: invalid number
pushd: usage: pushd [-n] [+N | -N | dir]
/tmp
./builtins12.sub: line 24: popd: -x: invalid number
popd: usage: popd [-n] [+N | -N]
/ /tmp
./builtins12.sub: line 27: popd: dir: invalid argument
popd: usage: popd [-n] [+N | -N]
/
/tmp
/tmp /
/bin /tmp /
./builtins12.sub: line 35: popd: -8: directory stack index out of range
./builtins12.sub: line 36: popd: +8: directory stack index out of range
/tmp /
/
./builtins.tests: line 325: exit: status: numeric argument required
after non-numeric arg to exit: 2
|